Skip to content

Instantly share code, notes, and snippets.

@hyperlogic
Created April 30, 2016 05:28
Show Gist options
  • Save hyperlogic/3c9c16f109a821fbb0325ff3caaf6697 to your computer and use it in GitHub Desktop.
Save hyperlogic/3c9c16f109a821fbb0325ff3caaf6697 to your computer and use it in GitHub Desktop.
Move the avatar in a circle!
var theta = 0;
function update(dt) {
theta += 0.01;
// update
var speed = 3.0;
MyAvatar.motorVelocity = {x: speed * Math.cos(theta), y: 0, z: speed * Math.sin(theta)};
MyAvatar.motorTimescale = 0.25;
}
Script.update.connect(update);
Script.scriptEnding.connect(function() {
Script.update.disconnect(update);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment