Skip to content

Instantly share code, notes, and snippets.

@dprado75
Last active November 10, 2020 01:22
Show Gist options
  • Save dprado75/6c13e527f51ed2684761144432544bcf to your computer and use it in GitHub Desktop.
Save dprado75/6c13e527f51ed2684761144432544bcf to your computer and use it in GitHub Desktop.
Code snippet to block visitor movements for Mozilla Hubs Cloud
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