Reputation: 1
Hey I'm a new Unity Coder and a bit stumped with a problem. When I jump onto a object using Rigid body 2D, There seems to be a centre of gravity kind of thing going on where my character tips over the platform. It there a fix for this where when the whole bottom of it drops when the whole thing is off?
Player Tipping Over
RigidBody Settings
Upvotes: 0
Views: 136
Reputation: 1007
The problem is that you don't have any constraints. Constraints basically tell the Rigidbody2D which way it can rotate and which way it can move. If you click the little Constraints
drop-down menu in the Rigidbody2D settings, you should get a menu that has
FreezePosition [] x [] y
FreezeRotation [] z
Since we are in the 2D, the only axis we can rotate along is the z (z is the blue axis that goes through the player). You should click the check box next to z to constrain it along that axis.
FreezeRotation [#] z
This way, the Rigidbody2D is not allowed to rotate based on its physics.
Upvotes: 1