Animation Events & Notifies: Triggering Gameplay from Animation

What Are Animation Events and Notifies?

Animation events (Unity) and Animation Notifies (Unreal Engine) are markers embedded on specific frames of an animation clip that trigger game logic at precise moments during playback. Rather than using timers or guessing when a character's foot hits the ground or when a sword swing reaches its apex, you mark the exact frame in the animation editor and fire a callback. The game then reacts in perfect synchronization with the visual.

This mechanism is essential for making games feel responsive and believable. Without animation events, a game character might play a footstep sound a few frames before or after the foot actually contacts the ground, breaking immersion. Hit detection might activate slightly too early or too late during an attack, causing invisible or delayed hits. Animation events solve these timing problems by anchoring game logic directly to animation frames.

This guide covers the full scope of animation events and notifies: common use cases, implementation in both Unreal Engine and Unity, best practices, and debugging strategies to track down timing issues.

Footstep Sounds Synced to Walk Animation

The footstep is the most universal use of animation events. Every character locomotion system needs footstep audio that matches the visual contact of feet with the ground. Getting this wrong — even by two or three frames — is immediately noticeable to players.

Finding the Contact Frame

To place a footstep event correctly, scrub through your walk or run animation in the engine's animation editor and find the frame where the heel first makes full contact with the ground surface. This is the contact frame — the moment of maximum impact, which should feel the hardest and sound the loudest. Some games use the initial contact frame; others delay one or two frames to account for audio latency in their target hardware. Testing on actual target hardware is essential.

Surface Material Integration

Professional footstep systems do not play a single hardcoded sound. Instead, the animation event fires a Footstep event that the character's audio component handles by:

  1. Performing a line trace (raycast) downward from the foot bone position
  2. Reading the Physical Material of whatever surface is hit (concrete, grass, wood, metal, gravel)
  3. Playing the appropriate footstep sound variant from an audio asset group for that material
  4. Optionally spawning a particle effect (dust puff on dirt, splash on water, sparks on metal)

This decoupling means artists can adjust animation timing by moving the event frame, and audio designers can replace sound assets, without either team touching game code.

Particle Effects on Attack Impact

Melee and ranged attacks need visual feedback at the exact moment of impact. A slash attack should spawn a blood or energy particle at the point of contact, not at the start or end of the animation. The particle must appear on the frame where the weapon is at maximum velocity or at the specific frame the artist identified as the "hit frame" during animation.

In practice, the animation event on the hit frame triggers a SpawnParticle notify that:

  • Fires a VFX emitter at the weapon socket or a predicted impact location
  • Plays the impact sound effect
  • Triggers a screen shake or gamepad rumble for the attacker
  • Notifies the game logic that the hit window is open (enabling damage collision)

Breaking these into separate notifies (one for VFX, one for audio, one for hit box) keeps concerns separated and lets different team members adjust each independently.

Triggering Hit Detection Windows

Melee combat systems use animation events to define the exact window during which the weapon can deal damage. This "hit detection window" — sometimes called the "active frames" in fighting game terminology — is bounded by two events:

  • Notify Begin: Activate the weapon collision volume (enable the hit box)
  • Notify End: Deactivate the weapon collision volume (disable the hit box)

In Unreal Engine, this is done using a Notify State — a notify with a begin and end event that spans a range of frames rather than triggering on a single frame. The Notify State can call ActivateWeaponCollision() on begin and DeactivateWeaponCollision() on end, giving precise frame-accurate control over when the character can deal damage.

This approach prevents the "hitbox is always on" problem that causes damage to trigger during wind-up or recovery frames, where the weapon is not visually in a position to hit anything. It also enables combo systems — if the hit detection window is closed, the attack cannot connect, giving players and enemies accurate feedback about attack timing.

Weapon Trail Effects

Weapon trails (the streak of light or blur that follows a sword or axe through a swing) need to be active only during the swing itself, not during idle or recovery. A Notify State spanning the swing frames enables and disables the trail VFX component:

  • On Notify Begin: Call WeaponTrail.Activate()
  • On Notify End: Call WeaponTrail.Deactivate()

The trail system then procedurally generates the streak geometry between the weapon's current and previous positions each frame. Because the animation event controls the enable/disable timing, the trail always starts and stops exactly when the visual swing does, regardless of animation playback rate or game difficulty scaling.

Screen Shake on Landing

A landing from a jump should include a camera shake that corresponds to the impact force. The landing animation has a specific frame where the feet make contact — this frame is the correct place to fire the screen shake event. The event can pass metadata about the jump height (calculated in code before the landing animation plays) so the camera shake magnitude scales with impact severity.

Additional events during the landing animation might handle:

  • Spawning dust particle effects at foot contact points
  • Playing the landing impact sound
  • Temporarily adjusting movement speed (landing recovery frames)
  • Triggering environmental reactions (cracking ice, denting soft ground)

Unreal Engine: Animation Notifies

Unreal Engine's Animation Notify system is deep and extensible. All notifies are created and placed in the Animation Sequence or Montage editor.

Built-in Notify Types

  • AnimNotify: Single-frame event. Subclass in Blueprint or C++ to add custom logic. Fire-and-forget.
  • AnimNotifyState: Has begin, tick, and end callbacks. Spans a frame range. Use for hit windows, trails, and states that persist for multiple frames.
  • Play Sound Notify: Built-in notify that plays a Sound asset at a socket location. No code required.
  • Play Particle Effect Notify: Built-in notify that spawns a particle system at a socket. Fast to set up for common effects.
  • Footstep Notify: A built-in or custom notify that handles footstep surface detection and audio selection.

Custom Notify in Blueprint

To create a custom Blueprint notify in Unreal:

  1. In the Content Browser, right-click → Animation → Animation Notify
  2. Name it (e.g., AN_AttackHitBegin)
  3. Open it and override the Received_Notify function
  4. Use the Mesh Component and Animation inputs to get the owning actor and call any required functions
  5. Place it on your animation timeline in the Notify track

Notify Tracks and Organization

Unreal lets you create multiple named notify tracks on a single animation. Use separate tracks for Audio, VFX, Gameplay, and Debug notifies. This visual organization makes it easy to review timing relationships and prevents a crowded single track where notifies overlap and become hard to select.

Animation Montage Notifies

Notifies in Animation Montages are particularly powerful because Montages are designed for complex, triggered actions like attacks and abilities. Montage notifies fire in the same way as Sequence notifies, but the Montage adds section markers (combo points, loop points) that give designers high-level control over action flow. A combo attack Montage might have five sections with notifies in each section for hit detection, VFX, and transition prompts.

Unity: Animation Events

Unity's Animation Events are functions called on components attached to the same GameObject as the Animator. They are simpler than Unreal's notify system but highly effective for most use cases.

Adding Animation Events in Unity

  1. Open the Animation window (Window → Animation → Animation)
  2. Select the animation clip in the Animator or Project panel
  3. Navigate to the target frame by dragging the playhead
  4. Click Add Event (the small flag icon in the timeline)
  5. In the Inspector, select the function to call from a dropdown of all public functions on attached scripts
  6. Optionally pass a float, int, string, or Object parameter to the function

Event Function Signatures

Unity animation event functions must be public and match one of these signatures:

  • public void OnFootstep() — no parameter
  • public void OnFootstep(float volume) — float parameter
  • public void OnFootstep(int foot) — int parameter (0 = left, 1 = right)
  • public void OnFootstep(string surface) — string parameter
  • public void OnFootstep(AnimationEvent evt) — full event object with all parameters

The AnimationEvent parameter gives you access to all four parameter types simultaneously plus the clip reference, which is useful for logging and debugging.

State Machine Behaviors in Unity

For logic that needs to run during an entire Animator state (not just a single frame), Unity provides State Machine Behaviors. These are scripts that attach to an Animator state and override:

  • OnStateEnter: Called when the state is entered
  • OnStateUpdate: Called every frame the state is active
  • OnStateExit: Called when the state is exited
  • OnStateIK: Called after IK is computed for this state

State Machine Behaviors complement Animation Events: use events for precise single-frame triggers within a clip, and State Machine Behaviors for persistent logic tied to a state's lifetime. For example, an Attack state might have a State Machine Behavior that enables aggressive AI targeting on enter and restores normal targeting on exit, while individual animation clips within that state use events for hit windows.

Best Practices: Don't Put Logic in Notifies

The most important best practice is also the most counterintuitive: animation events should not contain game logic. They should call a well-defined function on the character's component or controller and let that component handle the logic. Why?

  • Testability: Game logic in a component can be unit tested. Logic buried in an animation asset cannot.
  • Reusability: Multiple animations can fire the same footstep event and the audio system handles it consistently. If each animation had its own embedded logic, you'd have duplicated and divergent code.
  • Separation of concerns: Animators control when events fire. Programmers control what events do. Neither team should be blocked by the other.
  • Safety: Animation events can fire during editor previews, during LOD transitions, or while the character is being destroyed. Thin event handlers that delegate to components can guard against these edge cases. Fat embedded logic often cannot.

The ideal animation event handler is two lines: verify the component is valid, then call a function on it. Everything else happens in game code.

Debugging Animation Events

When animation events do not fire as expected, the debugging process has clear steps:

Verify the Event Is Placed Correctly

Open the animation in the engine's animation editor and confirm the notify/event marker is on the correct frame. Preview the animation and watch whether the event fires in the editor's notification console. In Unreal, the Persona editor shows notify firings in the viewport; in Unity, you can add a Debug.Log to the event function to confirm timing in the Console window.

Check Component Attachment

In Unity, the function called by an animation event must exist on a component attached to the same GameObject as the Animator. If you moved the logic to a child object or parent object, the event cannot find it. In Unreal, Blueprint notifies receive the Mesh Component — check that you are getting the owning Actor correctly from the mesh component before calling functions on it.

LOD and Culling

Animation events may stop firing on characters that are culled or reduced to a low LOD level. Unreal's Skeletal Mesh Component has an Allow Animation Curve Evaluation setting that can suppress notifies at distance. Unity's Animator Culling Mode similarly stops animation updates (and therefore events) when set to Cull Completely. For critical gameplay events (footstep sounds, hit detection), switch to a culling mode that allows logic updates even off-screen.

Animation Compression

Aggressive animation compression can shift keyframe timing slightly. If a notify is placed at frame 14 but compression removes that frame and interpolates from 12 to 16, the notify fires at the wrong time. Place notifies on keyframed frames, not interpolated frames, whenever possible. In Unreal, you can check which frames are keyframed in the animation editor's curve view.

Frequently Asked Questions

Can animation events slow down my game?

Animation events themselves have negligible performance cost. The functions they call may have significant cost — spawning particles, performing raycasts, playing audio. Profile the callbacks, not the events themselves. If footstep raycasts are expensive, cache the surface material for a few frames rather than querying every footstep.

Can I use animation events on motion capture animations?

Yes — motion capture animations support events/notifies exactly like keyframe animations. After importing a mocap clip, open it in the animation editor and add notifies manually. Many professional motion capture packs come with pre-placed foot contact markers in metadata that can be converted to notifies automatically using tools like Unreal's Curve Compression or custom import scripts.

What happens if an animation event fires during a blend?

If two animations are blending and both have events on overlapping frames, both events can fire. This commonly causes double footstep sounds during blend transitions. Solutions include using a threshold check (only fire the event if this animation's blend weight is above 0.5) or using notify states with a dominant-weight check in the tick function.

How do I sync animation events across networked multiplayer?

Animation events should generally not be responsible for authoritative game logic in multiplayer. The server runs authoritative combat logic using cooldown timers and hitbox collision, and the client plays animations locally. Animation events on the client can trigger cosmetic effects (footstep sounds, VFX, screen shake) without network synchronization because these are visual-only. Authoritative effects (damage, buffs) should be triggered by server-side logic, not by client animation events.

Can animation events trigger cutscene or dialogue sequences?

Yes, though it is more common to use a Sequencer (Unreal) or Timeline (Unity) for cutscenes. Sequencer in Unreal supports a full event track that fires Blueprint or C++ events at specific frames, with the same power as animation notifies but integrated into the cinematic timeline. For gameplay-triggered conversations, an animation event on the NPC's greeting animation can activate a dialogue component, but ensure guards against repeated triggering if the NPC loops the animation while waiting for the player to approach.

Build Precise, Responsive Characters with Motion Capture

The quality of your animation events is limited by the quality of the underlying animations. Footstep events only work correctly if the foot contact frames are visually clean and consistent. Hit detection windows are only satisfying if the attack animation has a clear, readable wind-up, impact, and recovery. Motion capture animations captured from real performers deliver the natural timing, weight, and physical authenticity that make events feel tight and impactful.

Our motion capture animation packs are designed for real-time engines and include clean contact frames, readable attack timing, and consistent foot placement — everything you need to build reliable, frame-accurate animation event systems.

Browse All Motion Capture Animation Packs →

Animation Packs with Clean Event Timing

Implementing animation events and notifies requires source animations with predictable timing and clean keyframe data. MoCap Online provides professionally captured motion capture packs with consistent frame rates and well-defined contact points, making it straightforward to add footstep events, hit detection notifies, and sound triggers. Available in FBX, BIP, Unreal Engine, Unity, Blender, and iClone formats.

Browse the Animation Library → | Try Free Animations