c-frame / aframe-extras

Add-ons and helpers for A-Frame VR.

Home Page:https://c-frame.github.io/aframe-extras/examples/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Propagate the enabled flag to controls

vincentfretin opened this issue · comments

Discussed on WebXR a-frame discord with @jameskane05 because he saw the same issue on Above Par-adowski WebXR Mini-Golf.
On https://aframe-xr-starterkit.glitch.me (github) when I switch from move (movement-controls) to teleport (blink-controls), so effectively setting movement-controls="enabled:false", blink smooth turn or snap turn I don't remember which doesn't work properly because game-controls is actually still active and both components blink-controls and gamepad-controls modify the camera rig rotation.
The enabled:false flag doesn't propagate to the controls, setting gamepad-controls="enabled:false" fixes the issue.
If you don't allow selecting free movement in your experience, you actually don't need gamepad controls so you probably want to list explicitly the controls you want, so if you need only the keyboard controls for desktop, set movement-controls="controls:keyboard"

I think it's fair to expect the enabled flag to be set on all the controls? We should fix that.

I did the changes in #415
No one against it?

Note that even with this changes, if you have both blink-controls and gamepad-controls enabled, it snap turns when you go full on the joystick because of blink-controls and it's clearly not what you want when you move. blink-controls can't currently be disabled, I created an issue jure/aframe-blink-controls#24