Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detaching WebXR teleportation before controllers load doesn't fully disable teleportation #7419

Closed
nbduke opened this issue Jan 10, 2020 · 3 comments
Assignees
Milestone

Comments

@nbduke
Copy link

@nbduke nbduke commented Jan 10, 2020

Bugs

Repro playground: https://playground.babylonjs.com/#AM07G2#47

Notice that the teleportation is detached immediately after creating the default WebXR experience. This is typically before controllers have loaded. I would expect that calling detach at any time fully disables teleportation, but in reality if a controller loads after the call, its thumbstick will cause the camera to turn. In fact, pushing forward on the thumbstick (to induce teleportation) causes an exception to be thrown.

Seems like detach ought to unregister from onControllerAdded observable.

@RaananW
Copy link
Member

@RaananW RaananW commented Jan 10, 2020

Good catch, thanks! You are a blessing, testing everything :-)

Keep on bringing those, we want everything to work correctly till 4.1 is released.

Fix is easy, coming up soon.

Oh, on a side note, if you don't intend on using the feature at all, disable it using the features manager:

fm.disableFeature(BABYLON.WebXRMotionControllerTeleportation.Name);

@nbduke
Copy link
Author

@nbduke nbduke commented Jan 10, 2020

Haha, thanks for being quick with the fixes!

Interesting about the features manager... What's the right way to do it if I want teleportation disabled by default but optionally enabled later by the user?

@RaananW
Copy link
Member

@RaananW RaananW commented Jan 10, 2020

the default experience manager has them both on per default. I can add this in the options (would actually make sense).
About enabling and disabling, you can use the attach and detach if the configuration didnt change, or re-enable if you want to change the initial configuration.
So if you don't want teleportation completely, disable the feature (using the features manager), and if you want to enable it later, use detach and attach. The main difference is that by re-enabling the feature is re-constructed, and (re)attach uses the old class again.
If you want a one-stop-shop, the features manager can do everything without touching the plugins at all, but you have the option to use the plugin directly.

RaananW added a commit to RaananW/Babylon.js that referenced this issue Jan 10, 2020
bilkusg pushed a commit to bilkusg/Babylon.js that referenced this issue Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants