Hi!
After i locked the rotation constraints i still can add rotation with rigidbody.AddTorque.
(If i lock position constraints, then i cant use AddForce on the object.)
And if the rigidbody collide with other object under the effect of addtorque , then it will ignore all rotation constraint.
here the example video:
(in the video i have not locked the y axis. btw no difference)
Okey i found the solution. If the rigidbody have a child collider then it recalculates the inertiaTensorRotation. I have to manually set the inertiaTensoreRotation (at my case its quaternion.identity)
Note that position constraints are
applied in World space, and rotation
constraints are applied in Local
space.
I could not find any reference as to which coordinate systems the Rigidbody.AddTorque uses, however in Rigidbody.AddRelativeTorque:
Adds a torque to the rigidbody
relative to its coordinate system.
Therefore I presume AddTorque should add a torque in World space system, and the rotation constrains are applied in Local space. Perhaps you could try using Rigidbody.AddRelativeTorque instead.