Last active
November 10, 2020 01:22
-
-
Save dprado75/6c13e527f51ed2684761144432544bcf to your computer and use it in GitHub Desktop.
Code snippet to block visitor movements for Mozilla Hubs Cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function showHoverEffect(el) { | |
//... | |
//insert before return line - return (isSpawner || !isPinned || isFrozen) && canMove; | |
if (window.APP.hubChannel.can("spawn_emoji")) | |
{ | |
//enable visitors movements | |
AFRAME.scenes[0].systems["hubs-systems"].characterController.isMotionDisabled = false; | |
AFRAME.scenes[0].systems["hubs-systems"].characterController.isTeleportingDisabled = false; | |
} | |
else | |
{ | |
//disable visitors movements | |
AFRAME.scenes[0].systems["hubs-systems"].characterController.isMotionDisabled = true; | |
AFRAME.scenes[0].systems["hubs-systems"].characterController.isTeleportingDisabled = true; | |
} | |
//... | |
//return (isSpawner || !isPinned || isFrozen) && canMove; | |
//} | |
//Code snippet to block visitor movements | |
//Mozilla Hubs Cloud - https://github.com/mozilla/hubs | |
//The objective is for the room owner to block visitors movements by default and enable movement if checking spawn_emoji option in the room settings | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment