- Home /
Speed Cap for Rolling Ball
Currently, for a rolling ball I have a simple AddForce script. However, it constantly gains speed to the point where I'm afraid it's gonna go right through a wall because the physics engine can't keep up. How would I go about setting a "speed cap" on the ball? UnityScript, please.
Answer by Eric5h5 · Sep 09, 2012 at 08:14 PM
You actually don't need any scripting...use "continuous dynamic" for the ball's rigidbody collision detection, and "continuous" for any objects that the ball will collide with, then the ball won't go through anything no matter how fast it goes. If you want a speed cap anyway, you can use drag. Also the max angular velocity in the physics settings will prevent an object from rotating any faster than the specified limit, which effectively caps the speed (for rolling objects anyway).
Your answer
Follow this Question
Related Questions
AddForce made a ball fall with no accelleration 1 Answer
Kick a Ball - Add Force? 2 Answers
Game running at different speeds on different quality levels. 1 Answer
AddForce() and limiting speed due to friction. 1 Answer
Ball physics help 2 Answers