UGameplayEffect
#include "GameplayEffect.h" Description
A data-only class that defines how gameplay attributes are modified: damage, healing, buffs, debuffs, and cooldowns. Configured entirely in the editor or as a C++ CDO; never instantiated at runtime.
Caveats & Gotchas
- • GameplayEffects are CDO-driven — all gameplay logic reads from the class defaults. Do not store mutable runtime state on a UGameplayEffect subclass.
- • Duration policy matters: Instant effects apply immediately and have no active handle; Duration and Infinite effects create an FActiveGameplayEffect that can be removed.
- • Modifiers apply to current (base + modifiers) or base value depending on EGameplayModOp. Additive modifiers on a scalable float will not stack as expected if you're not accounting for the magnitude curve.
Example
Apply a damage effect class from C++ C++
// Apply GE_Damage to a target's ability system component
FGameplayEffectContextHandle Context = SourceASC->MakeEffectContext();
FGameplayEffectSpecHandle Spec = SourceASC->MakeOutgoingSpec(UGE_Damage::StaticClass(), Level, Context);
SourceASC->ApplyGameplayEffectSpecToTarget(*Spec.Data.Get(), TargetASC); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?