after saying: rb.freezeRotation = false
all rotation constraints even the one on x and y axis will be removed, but we still want to keep x and y rotation still locked after returning command to physics to take over, therefore i write:rb.constraints = (RigidbodyConstraints)56;
: this code instead of unfreezing all rotations only unfreezes z rotation
5 Likes
Remember that you can also use the bitwise OR
operator to combine constraints, it also makes your code more readable.
3 Likes
many thanks for the pointer
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.