Tricky_Fat_Cat

12_pb_cu2 freeze rotation method

Sep 11th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. private void FreezeRotation(bool is_frozen)
  2.     {
  3.         if (is_frozen)
  4.         {
  5.             rigidBody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;
  6.             print("Rotation is frozen"); // Using for debugging, you can delete this message freely
  7.         }
  8.         else
  9.         {
  10.             rigidBody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY;
  11.             print("Rotation is unfrozen"); // Using for debugging, you can delete this message freely
  12.         }
  13.     }
Add Comment
Please, Sign In to add comment