Freeze object?

How do i freeze an object when clicked on it.
I know how to change the ‘use gravity’ but, how do i make it freeze?
And also unfreeze?

Because if i click now, the ‘use gravity’ turns off, and it’s now a object in space… which, is logical, but, again, how do i make it freeze?

thank you

The RigidBody component has a constraints field where you can freeze X,Y or Z movement as well as X,Y or Z rotations.

You can also modify those by script. Here’s the documentation on that: