Exit node in animation state machines

Hi epic,

I use a blend poses by enum and each kind of weapon have its state machine.

Soo Only changed the enum and fire the equipment animation saving code and flag variables.

sooo If I will have a exit node, I will fire also the unequip animation saving again code and flags variables. ( I put a draw to balance my lack of english :P)

I cant find ‘blend poses by enum’ when I right-click in my state machine. How did you set that up? Thanks!

hi, AdamZ

“blend poses by enum” dont exist, you need create a enumeration first and search the name of the enumeration.

Hi erWilly,

Thank you for your request, I have entered a feature request, UE-11955 to be considered by the development staff.

Hey erWilly,

There are a few ways around a need for an exit path like this. I’m attaching a blank project(see the end of the post) with some animations that I yanked from ShooterGame.

What I’ve done is created an AnimBP (Solution2 in the project) that achieves the “Unequip” action in the way I believe you want it to work (in my example, it’s simply the Equip anim played in reverse as ShooterGame has no Unequip anim)

If any of this doesn’t make sense, let me know and I can help out. If anybody has a more elegant solution, please feel free to show me up!! I welcome it. :slight_smile:

Blend inside each state:

*Enum Value 0 is the Rifle and Enum Value 1 is the launcher.
TL;DR The following **EventGraph **setup momentarily ticks **bIsUnequiping **to **true **whenever **WeaponEnumVal **changes, causing the State Machine to transition to the Unequip Animation.

In the Event Graph, I’ve set up a system that sets bIsUnequipping to true whenever the WeaponEnumVal byte variable changes. It does this by storing the persistent value of **WeaponEnumVal **in a temporary variable called WeaponEnumVal-Old, then updates WeaponEnumVal-Old to match WeaponEnumVal after the other operations are complete.

Instead of performing the Blend operation outside of the State Machine, we are performing it inside each State.

This allows us to use one State Machine. It also allows the **transitions **to and from the Unequip state to be a natural part of the State Machine

There are some backwards looking **transitions **coming out of the Unequip state, but that’s only because it is using animations played in reverse.

Example Project

Hope that helps!! :smiley:

ummm Thanks Matt.Williams I will check this in my next project, look good.