Navigation
API > API/Plugins > API/Plugins/GameplayAbilities
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UGameplayEffectComponent
- UAbilitiesGameplayEffectComponent
- UAdditionalEffectsGameplayEffectComponent
- UAssetTagsGameplayEffectComponent
- UBlockAbilityTagsGameplayEffectComponent
- UChanceToApplyGameplayEffectComponent
- UCustomCanApplyGameplayEffectComponent
- UGameplayEffectUIData
- UGameplayEffectUIData_TextOnly
- UImmunityGameplayEffectComponent
- URemoveOtherGameplayEffectComponent
- UTargetTagRequirementsGameplayEffectComponent
- UTargetTagsGameplayEffectComponent
References
| Module | GameplayAbilities |
| Header | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/GameplayEffectComponent.h |
| Include | #include "GameplayEffectComponent.h" |
Syntax
UCLASS (Abstract, Const, DefaultToInstanced, EditInlineNew, CollapseCategories,
Within=GameplayEffect)
class UGameplayEffectComponent : public UObject
Remarks
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).
Variables
| Type | Name | Description | |
|---|---|---|---|
| FString | EditorFriendlyName | Friendly name for displaying in the Editor's Gameplay Effect Component Index ( |
Constructors
| Type | Name | Description | |
|---|---|---|---|
| Constructor |
Functions
| Type | Name | Description | |
|---|---|---|---|
| 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. | |
| UGameplayEffect * | GetOwner () |
Returns the GameplayEffect that owns this Component (the Outer) | |
| bool | OnActiveGameplayEffectAdded
(
FActiveGameplayEffectsContainer& ActiveGEContainer, |
Called when a Gameplay Effect is Added to the ActiveGameplayEffectsContainer. | |
| void | OnGameplayEffectApplied
(
FActiveGameplayEffectsContainer& ActiveGEContainer, |
Called when a Gameplay Effect is initially applied, or stacked. | |
| void | 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) | ||
| void | |||
| void | OnGameplayEffectExecuted
(
FActiveGameplayEffectsContainer& ActiveGEContainer, |
Called when a Gameplay Effect is executed. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| EDataValidationResult | IsDataValid
(
FDataValidationContext& Context |
Allow each Gameplay Effect Component to validate its own data. |
See Also
GameplayEffect.hfor further notes
especially on the terminology used (Added vs. Executed vs. Apply).