In this lesson, you will learn how to move beyond basic triggers by creating custom Blueprint AnimNotify classes to pass complex data directly from your animations.
Why Go Beyond Standard Notifies?
Standard AnimNotify events are simple "firing" signals—they tell the game that something happened, but they don't carry specific information. By creating a custom Blueprint class inheriting from AnimNotify, you can define variables (like damage values, sound categories, or effect scales) that are exposed directly in the Animation Sequence editor. This makes your animations "data-aware."
Creating Your Custom Notify
- Create the Class: In the Content Browser, right-click and select Blueprint Class. Search for
AnimNotifyin the "All Classes" search bar. - Add Data: Open your new class. Create variables, such as a
FloatnamedDamageAmountor anEnumnamedVFXType. Be sure to click the "Eye" icon next to each variable to make it "Instance Editable." - Implement the Logic: Override the
Received_Notifyfunction. This function runs the moment the animation hits the notify frame. You can now access your exposed variables here to influence gameplay, such as applying damage to an actor or spawning a specific emitter.
// Logic inside your Received_Notify function:
// You have access to MeshComp, Animation, and EventReference.
// You can use these to cast to your character and apply your custom data.
if (MyCharacter* Char = Cast<MyCharacter>(MeshComp->GetOwner())) {
Char->ApplyEffect(this->DamageAmount, this->VFXType);
}
Applying in the Timeline
Once saved, your custom notify will appear in the right-click menu of any Animation Sequence timeline under a custom category. When you place it, the "Details" panel will show your DamageAmount and VFXType fields. You can now configure these values differently for every single frame where this notify occurs, allowing for highly modular and reusable animation events.
This approach prevents "spaghetti code" in your Animation Blueprint and keeps your logic neatly contained within the animation asset itself.
Key Takeaway: Creating custom AnimNotify classes allows you to bundle specific data with animation frames, turning simple triggers into flexible, data-driven gameplay tools.