Forum Discussion

MrSchadenfreude's avatar
MrSchadenfreude
Honored Guest
20 days ago

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

  • 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.

→ Find helpful resources to begin your development journey in Getting Started

→ Get the latest information about HorizonOS development in News & Announcements.

→ Access Start program mentor videos and share knowledge, tutorials, and videos in Community Resources.

→ Get support or provide help in Questions & Discussions.

→ Show off your work in What I’m Building to get feedback and find playtesters.

→ Looking for documentation?  Developer Docs

→ Looking for account support?  Support Center

→ Looking for the previous forum?  Forum Archive

→ Looking to join the Start program? Apply here.

 

Recent Discussions