Introduction
In this section, we learn how to use GameplayEffectContainer feature inside GGA to make a simple melee attack ability.
Steps to making melee abilities with Container
Typically, you configure a GameplayTag->GameplayEffectContainer mapping on your melee GameplayAbility asset (GGA_GameplayAbility already has one, called EffectContainerMap
).
It represents getting targets for different events (represented by Tags) using different TargetingPresets and applying multiple GameplayEffects to the targets.

Then, when the melee ability plays an animation, send an event (SendGameplayEventToActor) to the actor with an anim notify state.
The image below sends a GameplayEvent
called GroundPound
, which triggers an effect container called GroundPound
configured in ability's default setting.

ApplyEffectContainer will be triggered after the ability receives the relevant event. Its internal execution flow is:
- Find the corresponding Container in the EffectContainerMap through EventTag, create an instance(spec) of the Container.
- When creating container instance, internally, it will get targets using targeting preset and add results to TargetData, as well as creating all instances of specified gameplay effect classes.
- Then apply all gameplay effect instance to gathered actors.

Since that previous animation performs an ability with a wide-range attack, we can see how its TargetingPreset is configured.
It defines sphere collision with a radius of 1m and a length of 6m, and only detects pawn.
