Animation State Machine
State graph
Transitions
Child states
let movementDirection = 0
let falling = false
const walk = new AnimationState(walkClip)
const walkLeft = walk.createChild(walkLeftClip, () => movementDirection < 0)
const walkRight = walk.createChild(walkRightClip, () => movementDirection > 0)
const fall = new AnimationState(fallClip)
walk.transitionsBetween(fall, () => falling)Last updated