- Home /
How to keep an object flat when bouncing
I'm bouncing a cube over a plane with a bouncy physic material. Then I'm manipulating that cube so that I can move it along the x and z axis.
I'm using rigidbody.AddForce to move the cube along those axis, and when I do that the cube no longer falls flat. Obviously when it collides with the plane it starts rotating and it no longer falls flat...
I've also tried manipulating transform.position instead of adding forces, but somehow after a few bounces the same happens.
So how can I avoid this? How can I make the object always fall flat (without any kind of rotation)?
Answer by Hoeloe · Oct 31, 2013 at 07:29 PM
In the rigidbody settings in the inspector, there is a tab for "Constraints". By checking the constraints for the rotation axes, you stop it from ever changing its rotation, which will ensure it lands flat.
Your answer
Follow this Question
Related Questions
Avoid bouncing when ground move down 1 Answer
Force in Circular Motion 1 Answer
Object with rigidbody bounces after hit. 0 Answers
make object rotate towards its direction after bounce 1 Answer