Skip to main content
New Participant
November 23, 2025
Question

Limiting camera movement

I'm a beginner dev and I know this is probably a very basic problem but I've been pulling my hair out trying to solve it. 

I'm having trouble with :

- Clamping the player height in between a certain height relative to the player model.
- Clamping the player X and Z to stop the player from leaning too far outside the player model.

Using unity and meta SDK btw

 

If anyone knows the solution or there's some documentation out there please point me to it πŸ™

Thanks in advance

1 reply

Participant
November 24, 2025

Hi MrSchadenfreude​ , I believe you cannot override the transform values of "CenterEyeAnchor" game object (i.e. the camera) - which I think it's by design. 

However in terms of XR user experience, I'd usually highly discourage on force-clamping your camera movement as this could cause user discomfort where camera suddenly doesn't follow user's head movement. Alternatively, you may consider setting up a boundary system so that if player goes too far, it pauses the app and redirects user to go back near the playing area before resuming.