Last active
October 31, 2019 21:21
-
-
Save hyperlogic/b66bd4c741eabd7be1ae5892fe7b7055 to your computer and use it in GitHub Desktop.
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
// click to sit, click again to stand | |
(function () { | |
var seated = false; | |
var entity; | |
this.preload = function(entityID) { | |
entity = entityID; | |
}; | |
this.clickDownOnEntity = function(entityID, mouseEvent) { | |
// If entity is clicked, sit | |
var props = Entities.getEntityProperties(entity, [ "position", "rotation" ]); | |
if (seated) { | |
MyAvatar.endSit(props.position, props.rotation); | |
} else { | |
MyAvatar.beginSit(props.position, props.rotation); | |
} | |
seated = !seated; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment