- Home /
How do I make a sphere bounce forward without adding a lateral force?
I'm trying to make a sphere bounce infinitely as it infinitely moves forward on a plane. The player can only control the horizontal movements of the sphere using the 'left arrow' and 'right arrow' keys. However, after each bounce, a lateral force is added which causes the sphere to move faster. The distance travelled by the sphere after one bounce is always greater than the distance travelled after the previous bounce. This isn't what I want. I want the sphere to keep bouncing forward at a constant speed.
Apparently, it's not possible to do it with physics. Are there any alternative ways to do this? Should this be done via animation?
I would think about it like this: This spheres 'walk' or 'run' animation is a bounce and unless you want physically based movement you should just make it an animation similar to how the average game does it.
Answer by Dedegege · May 03, 2015 at 11:02 AM
You can limit the velocity. You can write an if-clause that checks if your velocity is bigger then a maximum velocity you choose. If that happens it slows the sphere down by a force in the opposite direction or you normalise the velocity vector and then apply your maximum speed. Here is somebody with a similar question: http://answers.unity3d.com/questions/9985/limiting-rigidbody-velocity.html
Your answer
Follow this Question
Related Questions
Predict Spherical Ball Collision Direction 1 Answer
Multiple Cars not working 1 Answer
Unity 2D - How do I add the velocity and direction of an object to another object? 2 Answers
Distribute terrain in zones 3 Answers
Keep constant velocity 4 Answers