Unfreezing Rigidbody Position - Help

Hello, I’ve been having trouble with unfreezing the X and Z on my rigidbody through a script. In my script, I would like the X and Z position to unfreeze when the enemy detects the player.
Thank you :slight_smile:

First Unfreez all

Rigidbody.constraints = RigidbodyConstraints.None;

Then freez back which you don’t want to be unfreezed

Rigidbody.constraints = RigidbodyConstraints.FreezePositionY;

Please accept it if it works