How to freeze an object?


I want to freeze an object completely inside a physics world. By looking at other solutions i did:

  1. Constraints.FreezeAll
  2. kinematic = true
  3. set the mass to large value (100000)

Now the object freezes only until it is not hit by another object. If another object hits it, my target object should remain rock solid and not move.
One hack is to set the velocity to zero every frame, but its not a very efficient way.

How can i make the object stand rock solid?


I believe you already have a collider on that object. Simply remove the rigidbody, and your object will act like a wall. Just try not to move object without rigidbody thru script as it will be costly.

If you need to have the object moving around like a moving platform. Add rigidbody and turn on kinematic as you mentioned.

Looks like I was resetting the isKinematic to false. Hence the object was moving. Setting an object’s rigidbody’s iskinematic to true does the job of freezing it.