Click here to Skip to main content
15,887,862 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI am working on football game i have a character name lonhjhon tag name player and a ball tag name "ball" i need help in scripting regarding how to keep ball in front of player while player is moving forward or right left. (ball control remain in player hand until he kicks) i have made the ball as child to the player but its just continuously attached to it from the start, i want to attach it in this way that if i move toward ball at certain position the ball control will be given to that player

here below is the logic diagram link for controlling ball
[^]
Posted
Updated 6-Dec-14 6:07am
v2
Comments
PIEBALDconsult 6-Dec-14 12:29pm    
That's the player's responsibility, not yours. :D
Basharat Hussain 6-Dec-14 12:53pm    
yes i know thats why am asking here how to make my player responsible
ZurdoDev 6-Dec-14 15:33pm    
Where are you stuck?
Basharat Hussain 6-Dec-14 15:48pm    
thanx for reply, i had made the player and the sphere with sphere collider and rigid body, if i move the player in ball direction when player collide with the ball it moves it but only for 2 or 3 times, and then ball left behind, i uses oncollisionenter method and if it is true transform.translate(vector3.back); but this wont work and ball left behind if you can help me in any logic that how ball control will be taken by player or in scripting i would be very grateful to you.

http://ge.tt/1v8CRP62
ZurdoDev 6-Dec-14 17:58pm    
Please click improve question and add the relevant code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900