From 3caea886413f63e6835ece7c3f3858d4f05c3f0e Mon Sep 17 00:00:00 2001 From: Faye Li Date: Fri, 7 Apr 2017 10:02:30 -0700 Subject: [PATCH] use JS method to enable/disable avatar collisions --- script-archive/selfieStick.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/script-archive/selfieStick.js b/script-archive/selfieStick.js index c6fb9c5349..fd3bb82145 100644 --- a/script-archive/selfieStick.js +++ b/script-archive/selfieStick.js @@ -13,7 +13,6 @@ // // Usage instruction: Spacebar toggles camera control - WASD first person free movement or no movement but allowing others to grab the selfie stick // and control your camera. -// For best result, turn off avatar collisions(Developer > Avatar > Uncheck Enable Avatar Collisions) // (function() { // BEGIN LOCAL_SCOPE @@ -25,12 +24,21 @@ var lensEntityID = null; var freeMovementMode = true; + turnOffAvatarCollisions(); changeAvatar(); importModel(); processImportedEntities(); setupSpaceBarControl(); Script.update.connect(update); + function turnOffAvatarCollisions() { + Menu.setIsOptionChecked("Enable avatar collisions", 0); + } + + function turnOnAvatarCollisions() { + Menu.setIsOptionChecked("Enable avatar collisions", 1); + } + function changeAvatar() { originalAvatar = MyAvatar.skeletonModelURL; MyAvatar.skeletonModelURL = AVATAR_URL; @@ -107,6 +115,7 @@ Camera.mode = "first person"; Controller.disableMapping("Handheld-Cam-Space-Bar"); MyAvatar.skeletonModelURL = originalAvatar; + turnOnAvatarCollisions(); } Script.scriptEnding.connect(cleanup); }()); // END LOCAL_SCOPE \ No newline at end of file