how to freeze rigidbody.constraints. code example
Example 1: rigidbody freeze position through code
rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ;
Example 2: how o free contraint in unity from script
m_Rigidbody.constraints = RigidbodyConstraints.None;