Navigation
API > API/Plugins > API/Plugins/GameplayAbilities
Gameplay Effect Component (aka GEComponent)
GEComponents are what define how a GameplayEffect behaves. Introduced in UE 5.3, there are very few calls from UGameplayEffect to UGameplayEffectComponent by design. Instead of providing a larger API for all desired functionality, the implementer of a GEComponent must read the GE flow carefully and register desired callbacks to achieve the desired results. This effectively limits the implementation of GEComponents to native code for the time being.
GEComponents live Within a GameplayEffect (which is typically a data-only blueprint asset). Thus, like GEs, only one GEComponent exists for all applied instances. One of the unintuitive caveats of this is that GEComponent should not contain any runtime manipulated/instanced data (e.g. stored state per execution). One must take careful consideration about where to store any data (and thus when it can be evaluated). The early implementations typically work around this by storing small amounts of runtime data on the desired callbacks (e.g. by binding extra parameters on the delegate). This may explain why some functionality is still in UGameplayEffect rather than a UGameplayEffectComponent. Future implementations may need extra data stored on the FGameplayEffectSpec (i.e. Gameplay Effect Spec Components).
| Name | UGameplayEffectComponent |
| Type | class |
| Header File | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/GameplayEffectComponent.h |
| Include Path | #include "GameplayEffectComponent.h" |
Syntax
UCLASS (Abstract, Const, DefaultToInstanced, EditInlineNew, CollapseCategories,
Within=GameplayEffect, MinimalAPI)
class UGameplayEffectComponent : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UGameplayEffectComponent
Derived Classes
UGameplayEffectComponent derived class hierarchy
- UAbilitiesGameplayEffectComponent
- UAdditionalEffectsGameplayEffectComponent
- UAssetTagsGameplayEffectComponent
- UBlockAbilityTagsGameplayEffectComponent
- UCancelAbilityTagsGameplayEffectComponent
- UChanceToApplyGameplayEffectComponent
- UCustomCanApplyGameplayEffectComponent
- UGameplayEffectUIData
- UImmunityGameplayEffectComponent
- URemoveOtherGameplayEffectComponent
- UTargetTagRequirementsGameplayEffectComponent
- UTargetTagsGameplayEffectComponent
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UGameplayEffectComponent() |
Constructor | GameplayEffectComponent.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool CanGameplayEffectApply
(
const FActiveGameplayEffectsContainer& ActiveGEContainer, |
Can the GameplayEffectSpec apply to the passed-in ASC? All Components of the GE must return true, or a single one can return false to prohibit the application. | GameplayEffectComponent.h | |
UGameplayEffect * GetOwner() |
Returns the GameplayEffect that owns this Component (the Outer) | GameplayEffectComponent.h | |
virtual bool OnActiveGameplayEffectAdded
(
FActiveGameplayEffectsContainer& ActiveGEContainer, |
Called when a Gameplay Effect is Added to the ActiveGameplayEffectsContainer. | GameplayEffectComponent.h | |
virtual void OnGameplayEffectApplied
(
FActiveGameplayEffectsContainer& ActiveGEContainer, |
Called when a Gameplay Effect is initially applied, or stacked. | GameplayEffectComponent.h | |
virtual void OnGameplayEffectChanged () |
Let us know that the owning GameplayEffect has been modified, thus apply an asset-related changes to the owning GameplayEffect (e.g. any of its fields) | GameplayEffectComponent.h | |
virtual void OnGameplayEffectChanged () |
GameplayEffectComponent.h | ||
virtual void OnGameplayEffectExecuted
(
FActiveGameplayEffectsContainer& ActiveGEContainer, |
Called when a Gameplay Effect is executed. | GameplayEffectComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual EDataValidationResult IsDataValid
(
FDataValidationContext& Context |
Allow each Gameplay Effect Component to validate its own data. | GameplayEffectComponent.h |
See Also
-
GameplayEffect.h for further notes
-
especially on the terminology used (Added vs. Executed vs. Apply).