Creating multiple state machines to handle different sets of animations

I understand the basic concept of a state machine and what it is used for. At least I think I do. The question I have is can you break up different phases of a characters animation into different state machines. So, for example I have a state machine that handles basic movement, but I would like to create others that handle things like combat or alternative movements. I know that I can combine all of these things into one state machine and use the conditional rules to get what I want, but it seems that over time this could get complicated and messy. I haven’t seen any examples of a character that is setup this way, so I’m thinking it isn’t the normal way to do it, but I wanted to ask just in case.

The anim graph does let you create multiple state machines, but like I said above, I’ve seen no examples of it in action. So, I’m a little unsure what the intended workflow is. Any help would be greatly appreciated.

I would be interested in this as well.

Basically just did this part this weekend.

When I get home I will upload my anim blueprint, basically I followed this :

up until the standard movement set ( run, idle, jump ) was completed, then I added extra Flipbook variables to the Enum and var list for the extra animations.

In my event graph I added a crouch ( you could do this for any new move / input ) input state and used it to set IsCrouched ( I tried to use the bIsCrouched but it didn’t work right at first so I just made new var ) to true / false when pressed / released.

Then casted IsCrouched from event state into AnimationState, and used that to set the new Flipbooks. This works great, just trying to figure out how to dynamically set loop status now.

It’s a pity that nobody has attempted to answer this :frowning:

Agreed. :frowning:

supersane practically answered this. But you can create another state machine and put it INSIDE OF A STATE.

So you can nest the complications away and hopefully simplify things for your brain.

I’ll expand on things a little more as it perhaps isn’t as obvious as it seems. Each state has an output, called Final Pose. Everything you feed into final pose is the thing that’s spat out of the state machine at the top and fed into the final final pose. Hopefully you understand that much about ue4’s animation system, if not here’s the documentation on the subject: Animation System Overview | Unreal Engine Documentation

Taking advantage of this basic behaviour, we can put a state machine inside of a state to get more advanced behaviour. The state machine simply makes decisions based on variables and animation playback.

1 Like

Thanx! I didn’t know this was possible and it works really well.

Wow, that’s my first comment on the forum, just wanted to say that this is awesome, had no idea, and as things started to get more complex in the animation side of things, it was getting difficult, this really helped, everything looks so much nicer now ahaha, thank you.

Me too v.v

Thanks man