Closed carolinaroqu3 closed 1 month ago
@carolinaroqu3 as others pointed out useController() is what you are looking for. For a working component you can drop in check out https://codesandbox.io/s/three-fiber-xr-headset-camera-bounds-box-tin2ko?file=/components/MovementController.js
ofc there is a lot of context on how you want movement to work in your personal project...factors like speed, gravity, collision, acceleration, tilt,...etc. You will eventually be coding for your own solution. The sky is the limit, but this simple example should get you started for basic movement.
Since the answer to this question has changed slightly in v6, I am linking to a simple tutorial that introduces how to implement locomotion for controlling the viewers position by controlling its origin.
Is there any possibility to use the joystick controls of the glasses to move the camera and walk around the scene?