ladderpatternexample

Ladder Pattern Animation Controller

This is a simple pattern for creating an ordered linear animation sequence in a Unity animation controller.  It is useful if an animation has a set sequence that must be traversed in order.  This pattern is simple to set up and allows for traversing the ladder to any step in the sequence from any step.  I've dubbed it the "Ladder Pattern" because it ends up resembling a ladder once it's put together.

The Bottom and Top "bars" of the ladder are made of the forward and reverse playing animation state, respectively.  The should be setup in pairs to that one forward and reverse set are aligned vertically with each other.

Each state is connected to it's neighbors with transitions.  Each transition has a condition that tests against an int parameter for the desired step. Each forward state will only progress if the step parameter is greater than that state's index.  If the step parameter is less than the step index, the state will transition to it's reverse state.  In this way the animation states will keep transitioning either forward or reverse until it rests at an index that is equal too the step parameter.  This allows for easy controls over any ordered animation sequence!