- Home /
Adding Force to a rolling ball
I have a game im building for a class project that is a ball track. The ball rolles down the track from an angle and should roll to the end. The problem is I can not get enough momentum from my hill for it to make it to the end.
What im needing is a way to add force to the ball when it rolls though an invisible collider on the track. I want it to add the force in the same direction its going.
Look in the Unity documentation for "AddForce".
moreover, you probably want "AddTorque" rather than AddForce in this situation.
If you really struggle with junior-high physic conceptss like force, mass, acceleration, torque, gravity, friction and so on ... working with a game engine is going to be a real struggle.
If you are unfamiliar with these concepts, I urge you to study them hard using the many resources available on the www.
Answer by CaioRosisca · Sep 22, 2012 at 02:32 AM
I'm not sure if i understood it, first of all I would add a rigidbody to the ball, once it has one add the following code:
rigidbody.AddForce(0, -forceValue,0);
This will add negative force to your ball on the y axis(relative to world space). So it the ball is actually rolling "down"..it will move faster.
Hope it helps.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
PinBall Flippers 1 Answer
Rest postion after animation plays 0 Answers
Spawning portal 1 Answer
Where is a good place to start Developing my Game? 5 Answers