Course contentsShow
← Unreal Engine Game Development
Lesson 681 of 8809. Gameplay Ability System (GAS)Free lesson

Managing Gameplay Cue Notify Actor Instances

Construct actor-based gameplay cues to manage complex, persistent visual effects that require internal state or tick-based logic during gameplay.

In this lesson, you will learn how to leverage AGameplayCueNotify_Actor to handle complex, persistent visual effects that require internal state or tick-based logic.

While AGameplayCueNotify_Static is perfect for "fire-and-forget" effects like impact sounds or instantaneous particle bursts, it lacks the ability to maintain state or update logic over time. When your Gameplay Cue needs to persist—such as a magical aura that changes intensity based on a player's distance to an enemy or a shield effect that flickers based on a timer—you must use AGameplayCueNotify_Actor.

Why Use an Actor-Based Notify?

Unlike the static approach, which is essentially a set of helper functions, the AGameplayCueNotify_Actor is an actual AActor instance spawned by the Gameplay Cue Manager. Because it is an actor, it gains access to the full Actor lifecycle, including:

  • Tick(): Perfect for updating shader parameters or tracking moving targets.
  • Internal Variables: Storing persistent data, such as a reference to a dynamic material instance or a Timeline component.
  • BeginPlay/EndPlay: Managing the lifecycle of components that need to be created and destroyed cleanly.

Implementation Pattern

When you implement AGameplayCueNotify_Actor, you override events like OnActive, OnExecute, or OnRemove. Crucially, you can store data on the actor instance itself:

// Inside your custom AGameplayCueNotify_Actor class
void AMyAuraCue::OnActive_Implementation(AActor* MyTarget, FGameplayCueParameters const& Parameters)
{
    // Initialize a persistent component or visual state
    AuraMesh = NewObject<UStaticMeshComponent>(this);
    AuraMesh->RegisterComponent();
    
    // Set state based on parameters
    CurrentIntensity = Parameters.RawMagnitude;
}

void AMyAuraCue::Tick(float DeltaTime)
{
    // Update visuals based on internal state
    AuraMesh->SetScalarParameterValueOnMaterials(FName("Intensity"), CurrentIntensity);
}

By keeping the effect logic inside its own actor, you prevent the Gameplay Ability System from becoming cluttered with visual bookkeeping. The Gameplay Cue Manager automatically handles the spawning and cleanup of these actors when the associated tag is added or removed from the GameplayEffect. This ensures your visual feedback remains decoupled from your gameplay logic.

Key Takeaway: Use AGameplayCueNotify_Actor when your visual effect requires ticking logic or persistent state that exceeds the capabilities of simple, static event-based triggers.