Adding fix for enabling saved front/back advanced controls.

This commit is contained in:
Wayne Chen 2018-05-25 09:20:55 -07:00
parent 534341ef62
commit 89f7eb0b30

View file

@ -171,4 +171,25 @@
Messages.subscribe(HIFI_ADVANCED_MOVEMENT_DISABLER_CHANNEL);
Messages.messageReceived.connect(handleMessage);
function initializeControls() {
if(HMD.active) {
if (Controller.Hardware.Vive !== undefined || Controller.Hardware.OculusTouch !== undefined) {
if (MyAvatar.useAdvancedMovementControls) {
Controller.disableMapping(DRIVING_MAPPING_NAME);
} else {
Controller.enableMapping(DRIVING_MAPPING_NAME);
}
if (MyAvatar.getFlyingEnabled()) {
Controller.disableMapping(FLYING_MAPPING_NAME);
} else {
Controller.enableMapping(FLYING_MAPPING_NAME);
}
});
}
}
initializeControls();
}()); // END LOCAL_SCOPE