Navigation
API > API/Plugins > API/Plugins/GameplayAbilities
Data structure that stores an instigator and related data, such as positions and targets Games can subclass this structure and add game-specific information It is passed throughout effect execution so it is a great place to track transient information about an execution
| Name | FGameplayEffectContext |
| Type | struct |
| Header File | /Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/GameplayEffectTypes.h |
| Include Path | #include "GameplayEffectTypes.h" |
Syntax
USTRUCT ()
struct FGameplayEffectContext
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FGameplayEffectContext
(
AActor* InInstigator, |
GameplayEffectTypes.h | ||
| GameplayEffectTypes.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FGameplayEffectContext() |
GameplayEffectTypes.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AddActors
(
const TArray< TWeakObjectPtr< AActor > >& IActor, |
Add actors to the stored actor list | GameplayEffectTypes.h | |
virtual void AddHitResult
(
const FHitResult& InHitResult, |
Add a hit result for targeting | GameplayEffectTypes.h | |
virtual void AddInstigator
(
AActor* InInstigator, |
Sets the instigator and effect causer. | GameplayEffectTypes.h | |
virtual void AddOrigin
(
FVector InOrigin |
Adds an origin point | GameplayEffectTypes.h | |
virtual void AddSourceObject
(
const UObject* NewSourceObject |
Sets the object this effect was created from. | GameplayEffectTypes.h | |
virtual FGameplayEffectContext * Duplicate() |
Creates a copy of this context, used to duplicate for later modifications | GameplayEffectTypes.h | |
const UGameplayAbility * GetAbility() |
Returns the CDO of the ability used to instigate this context | GameplayEffectTypes.h | |
const UGameplayAbility * GetAbilityInstance_NotReplicated() |
Returns the specific instance that instigated this, may not always be set | GameplayEffectTypes.h | |
int32 GetAbilityLevel() |
Gets the ability level this was evaluated at | GameplayEffectTypes.h | |
virtual const TArray< TWeakObjectPtr< AActor > > & GetActors() |
Returns actor list, may be empty | GameplayEffectTypes.h | |
virtual AActor * GetEffectCauser() |
Returns the physical actor tied to the application of this effect | GameplayEffectTypes.h | |
virtual FHitResult * GetHitResult () |
Returns hit result, this can be null | GameplayEffectTypes.h | |
virtual const FHitResult * GetHitResult () |
Returns hit result, this can be null | GameplayEffectTypes.h | |
virtual AActor * GetInstigator() |
Returns the immediate instigator that applied this effect | GameplayEffectTypes.h | |
virtual UAbilitySystemComponent * GetInstigatorAbilitySystemComponent() |
Returns the ability system component of the instigator of this effect | GameplayEffectTypes.h | |
virtual const FVector & GetOrigin() |
Returns origin point, may be invalid if HasOrigin is false | GameplayEffectTypes.h | |
virtual AActor * GetOriginalInstigator () |
Should always return the original instigator that started the whole chain. | GameplayEffectTypes.h | |
virtual UAbilitySystemComponent * GetOriginalInstigatorAbilitySystemComponent() |
Returns the ability system component of the instigator that started the whole chain | GameplayEffectTypes.h | |
virtual void GetOwnedGameplayTags
(
FGameplayTagContainer& ActorTagContainer, |
Returns the list of gameplay tags applicable to this effect, defaults to the owner's tags. | GameplayEffectTypes.h | |
virtual UScriptStruct * GetScriptStruct() |
Returns the actual struct used for serialization, subclasses must override this! | GameplayEffectTypes.h | |
virtual UObject * GetSourceObject() |
Returns the object this effect was created from. | GameplayEffectTypes.h | |
virtual bool HasOrigin() |
Returns true if GetOrigin will give valid information | GameplayEffectTypes.h | |
virtual bool IsLocallyControlled() |
True if this was instigated by a locally controlled actor | GameplayEffectTypes.h | |
virtual bool IsLocallyControlledPlayer() |
True if this was instigated by a locally controlled player | GameplayEffectTypes.h | |
virtual bool NetSerialize
(
FArchive& Ar, |
Custom serialization, subclasses must override this | GameplayEffectTypes.h | |
virtual void SetAbility
(
const UGameplayAbility* InGameplayAbility |
Sets the ability that was used to spawn this | GameplayEffectTypes.h | |
void SetEffectCauser
(
AActor* InEffectCauser |
Modify the effect causer actor, useful when that information is added after creation | GameplayEffectTypes.h | |
virtual FString ToString() |
Returns debug string | GameplayEffectTypes.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool CanActorReferenceBeReplicated
(
const AActor* Actor |
GameplayEffectTypes.h |