- Home /
script to add force to the ball in a football game!
i am working on a game football and i am writing a script to add force to the ball when user kicks it..
when player kick the ball the ball should go in the specific direction with the velocity relevant to the force of player's kick..!
help me with this to write the script.. i have script written but it contains errors and it is very long to put here so please help me to solve this...
Thanks !
Have you tried setting the ball.rigidbody.velocity = kickForce?
Answer by SolidSnake · Jun 21, 2012 at 04:09 PM
one way to do it is using the physics engine: rigidbodies + colliders + physics materials (bouncy).
then you can use all the physics parameters & functions to do add the force to specific direction
unless I didnt understand the question correctly
thanks for the answer , if u haven't understand the question then the question is when the player kick the ball the ball should go in the direction in which the player had kicked it and with the force that the player applied to it while kicking the ball..!!