How can i freeze Z Position. i tried constraints but didnt work. Please help me

I don’t have enough information about your setup to answer correctly. Regardless of Rigidbody settings, your Mover could move in any direction, meaning you have to mind the z within that script as well.
Post your Movement script and we’ll have a look.

If your game world is along the 0 Z axis, i guess something like this could work on your player;

void Update ()
{
     Vector3 lockedZpos = transform.position;
     lockedZpos.z = 0;
     transform.position = lockedZpos ;
}

Privacy & Terms