How to mathf.clamp a VR player?

Hello,

In walking simulation I want to restrict the players movement in VR, to the navmesh so I can control the players position from walls. I’ve used mathf.clam of a localPosition for the cameraEye component in [cameraRig], and clamped the min and max, x and z positions. While in playmode in the scene view this works perfectly, but in reality when placing the HTC Vive the user has free movement again.
Have you encountered such issue before?
How would you go about this?

It’s been a hot minute since I experienced this issue. If my memory serves me I overcame it by making my VR player a child of another transform. I could limit that transforms position. Be careful, though. Messing with rotation of this parent transform should be totally under the user’s control (if it can rotate at all.)

It can be sickening to have rotation controls taken away from the player.

Edit: This should be used stop any touchpad/joystick/WASD input from allowing them to walk too close to walls. You DO NOT want a situation where the player walks in the real world and doesn’t see the correctly updated image. Other games handle this by first doing what i mentioned above, then fading the image away as they get further from the intended play area. This is a much nicer nudge in the right direction for the player.