Teleportation controls to bind on only one controller

What he said ^

:slight_smile:

As you asked about VR - no, it is not possible. As WebVR is deprecated, we will not be adding new features there, but if you want it enabled in WebXR, please submit a ticket and I will implement it when I have the time.

About the two options - 1st one will sadly not work (as the input is the one firing the events).
Option 2 is a great way to do that. If you don’t want to deal with private methods (because typescript will complain a LOT), you can do something else (thou I haven’t tried it). Attach an observer to the input.onControllerAddedObservable, but add it to be first (the 3rd variable in the add function). Then, if it is the hand you want to not have teleportation on, set state.skipNextObservers to be true. Something like this:

xrInput.onControllerAddedObservable.add((controller, state) => { if (controller.handness === 'left') {
  state.skipNextObservers = true;
}, undefined, true);

This might have a few side effects (if you have other observers registered that are actually needed). so make sure to remove this observer after it was triggered.

The simplest solution, however, if to make it right and implement this feature :slight_smile:

2 Likes