Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created September 23, 2020 10:00
Show Gist options
  • Save ntakouris/874b1b50f6f05371f1bfdcab0783c798 to your computer and use it in GitHub Desktop.
Save ntakouris/874b1b50f6f05371f1bfdcab0783c798 to your computer and use it in GitHub Desktop.
h = imageElement.height
pos = h - hip.position.y;
if (pos < h * 0.2) {
toggleAction('crouch')
} else if (pos < h * 0.7) {
toggleAction('idle')
} else {
toggleAction('jump')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment