Skip to content

Instantly share code, notes, and snippets.

@Jimbly
Last active December 16, 2015 08:48
Show Gist options
  • Save Jimbly/5408241 to your computer and use it in GitHub Desktop.
Save Jimbly/5408241 to your computer and use it in GitHub Desktop.
Cloud Party: floating beach ball script
function tick() {
//error('test');
var z = getParam('ground_height');
var pos = getPos();
if (pos[2] < z) {
setGravity({ gravity: [0, 0, min(5, z - pos[2])] });
} else {
setGravity({ gravity: [0, 0, -9.8] });
}
}
timerCreate({
name:'tick',
period: 0.01
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment