Freeze Position/Rotation in local or world coordinates?

Hi,

I am new to Unity and when I tried to lock the position/rotation of a Game Object with a RigidBody Component I found two definitions in the Manual about which axes the constraints are applied:

  1. __http://docs.unity3d.com/ScriptReference/Rigidbody-constraints.html:__
    “…Note that the constraints are applied in the local space of the Rigidbody.”

2) __http://docs.unity3d.com/Manual/class-Rigidbody.html:__
“… Stops the Rigidbody moving in the world X, Y and Z axes selectively.”

Are these statements totally contradicting each other or am I completly missing something?

1 Like

Good point. They are not contradicting each other. They are just different (and yes, these little details are confusing and make it harder to work with the engine). For movement, the constraints happen in local space (coordinates on the gameObject) but for the rotation, constraints are based on global axes (the ones you see on the top-right corner of the scene window).

Personally, I wish it was more flexible and would allow the programmer to decide the axes or whether it’s based on local or global axes.