Not logged in - Login
< back

Gameplay Cues

AGameplayCueNotify_Actor vs UGameplayCueNotify_Static

AGameplayCueNotify_Actor is an actor instance that gets spawned in the level. It has state and can tick.
UGameplayCueNotify_Static is not an actor and is not instanced. UGameplayCueNotify_Static is good fromfor quick things like Hit Impacts that don't need state.

AGameplayCueNotify_Actor Lifecycle

For Duration and Infinite Gameplay Effects

When the Gameplay Effect is added, the attached Gameplay Cue fires WhileActive and OnActive events. When the Gamplay Effect is removed, the Gameplay Cue fires the OnRemove event.

Either bAutoDestroyOnRemove needs to be set to true or End (Recycle) Gameplay Cue needs to be manually called. Keep in mind that Gameplay Cues are not destroyed and recreated, so you will have to deal with re-initialization as the values from the previous Gameplay Cue will still be there when this Gameplay Cue is used a second time. AutoDestroyDelay can be used to delay the recycle X number of seconds when bAutoDestroyOnRemove is set to true.

For Instant Gameplay Effects

When the Gameplay Effect is added, the attached Gameplay Cue fires the OnExecute event.

AGameplayCueNotify_Actor Instancing

Gameplay Cues are automatically instanced by Class and Target. They are optionally instanced by Instigator and Source using bUniqueInstancePerInstigator and bUniqueInstancePerSourceObject. Here is the instancing formula in the Gameplay Cue Manager:

FGCNotifyActorKey NotifyKey(TargetActor, 
CueClass,
CDO->bUniqueInstancePerInstigator ? Parameters.GetInstigator() : nullptr,
CDO->bUniqueInstancePerSourceObject ? Parameters.GetSourceObject() : nullptr);

Send Messages to an already active AGameplayCueNotify_Actor

ExecuteGameplayCueWithParams can be used to send messages to an already running AGameplayCueNotify_Actor. The params passed in can be extracted in OnExecute in the Cue and be used to modify the currently active Gameplay Cue (change color of particle system, change size of particle system, hide/show particle system, etc.)

Example of GameplayCue OnActive

In this example we spawn a new particle system if our ref is null, otherwise we reattach it and set it to Visible.