Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void FreezeRotation(bool is_frozen)
- {
- if (is_frozen)
- {
- rigidBody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;
- print("Rotation is frozen"); // Using for debugging, you can delete this message freely
- }
- else
- {
- rigidBody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY;
- print("Rotation is unfrozen"); // Using for debugging, you can delete this message freely
- }
- }
Add Comment
Please, Sign In to add comment