I’m implementing VR via WebVR in my game which has a third person character controller.
I’m trying to figure how to limit the camera/VR head position so when a player crouches with headset it doesn’t move the camera to that relative Y position change.
I’ve tried referencing this.app.xr.camera.setPosition() and only changing the Y with no luck.
I don’t want players seeing through their character mesh, nor do I want the player looking through the character’s knees.
How would I go about limiting the VR head movement considering the Y-axis so crouching in real-time has no effect via client?
I also have a reference to the Head of the character mixamo rig, would binding the XR camera’s Y position to the Head position Y help?
You could offset parent entity position by local position of camera - which is based on XR tracking.
But. This can lead to VR sickness as will lead to desync between real world position and what brain expects to happen in VR.
Generally in VR you want to avoid any modifications and limitations to motion, otherwise to the player it feels “disconnected”.
I figured I shouldn’t change it yet it was an attempt to prevent players from crouching and being able to see within their character model. Most VR games toggles a crouch animation if the player happens to do so in the real world.
I’m still testing various ways to go about it, I even disabled the character model itself in some instances.