Using Animation Notifies in UE4

Integrating animation notifies in Unreal’s animation state machine

I recommend anyone interested in using event/animation notifies to check out Unreal’s documentation first. It goes over why you should take advantage of it, and some examples of use cases. It is mentioned in passing that notifies can be defined and used directly in the ASM (Animation State Machine), and I will show you how to do just that.

ASM

Using an Animation State Machine allows you to separate animation into states, and define parameters for when a skeletal mesh should enter these states. Knowing that you could use event notifies directly in the ASM can seem odd since you could just as simply define an anim notify in an animaton file itself. But if you only want an event to trigger once during a state (for example when entering an idle animation), then you should consider notifies in the ASM directly.

If not done already, create an animation blueprint for your character (In my case, I will be using the animation blueprint that is included with the 3rd person template).

creatingABP

In the state machine select either a state or transition and locate the details panel. Scroll down and you will see either a dropdown for notifications (if a transition is selected), or a dropdown for animation states (if a state is selected). Here is where we will define our custom notification.

LocationOfNotification2

In my example, I have a blendspace called AimingWalk that is played in the idle state, but I also want the blend space to run during the jump animation. To implement this, type the name of your custom event in the end transition event dialog box (using the transition into idle node).

typingNotify

In the event graph, RMB click and type in the name of the defined custom event. A new node should appear, and with this you can start binding the custom event. Whenever this is reached in the State Machine during runtime, the notify will trigger and your event will be called.

EventNode

With this, you can further explore animation notifies. In my example, I am toggling a bool whenever I start/stop jumping.

2 gif with and without notify

And as you can see, my aiming animation seamlessly blends between walking/jumping


©Andrew Montoya 2018. All rights reserved.