Merge pull request #13493 from alexiamandeville/sittingUpdate

Resolving issue where VR input for movement stops emotes
This commit is contained in:
John Conklin II 2018-07-02 12:30:50 -07:00 committed by GitHub
commit d9a3676c7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,6 +101,7 @@ function onWebEventReceived(event) {
// If user provides input during a sit, the avatar animation state should be restored
Controller.keyPressEvent.connect(restoreAnimation);
Controller.enableMapping(eventMappingName);
MyAvatar.overrideAnimation(ANIMATIONS[emoteName].url, FPS, false, 0, frameCount);
} else {
@ -132,6 +133,7 @@ function restoreAnimation() {
// Make sure the input is disconnected after animations are restored so it doesn't affect any emotes other than sit
Controller.keyPressEvent.disconnect(restoreAnimation);
Controller.disableMapping(eventMappingName);
}
// Note peek() so as to not interfere with other mappings.
@ -151,7 +153,7 @@ eventMapping.from(Controller.Standard.RS).peek().to(restoreAnimation);
eventMapping.from(Controller.Standard.RightGrip).peek().to(restoreAnimation);
eventMapping.from(Controller.Standard.Back).peek().to(restoreAnimation);
eventMapping.from(Controller.Standard.Start).peek().to(restoreAnimation);
Controller.enableMapping(eventMappingName);
button.clicked.connect(onClicked);
tablet.screenChanged.connect(onScreenChanged);