FGameplayEffectContextHandle

Handle that wraps a [FGameplayEffectContext](API\Plugins\GameplayAbilities\FGameplayEffectContext) or subclass, to allow it to be polymorphic and replicate properly

Windows
MacOS
Linux

References

Module

GameplayAbilities

Header

/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/GameplayEffectTypes.h

Include

#include "GameplayEffectTypes.h"

Syntax

[USTRUCT](Programming/UnrealArchitecture/Reference/Structs)([BlueprintType](Programming/UnrealArchitecture/Reference/Structs/Specifiers/BlueprintType))
struct FGameplayEffectContextHandle

Remarks

Handle that wraps a FGameplayEffectContext or subclass, to allow it to be polymorphic and replicate properly

Constructors

Name Description

Public function

FGameplayEffectContextHandle()

Public function

FGameplayEffectContextHandle

(
    FGameplayEffectContext* DataPt...
)

Constructs from an existing context, should be allocated by new

Destructors

Functions

Name Description

Public function

void

 

AddActors

(
    const TArray< TWeakObjectPtr< AActo...,
    bool bReset
)

Add actors to the stored actor list

Public function

void

 

AddHitResult

(
    const FHitResult& InHitResult,
    bool bReset
)

Add a hit result for targeting

Public function

void

 

AddInstigator

(
    AActor* InInstigator,
    AActor* InEffectCauser
)

Sets the instigator and effect causer.

Public function

void

 

AddOrigin

(
    FVector InOrigin
)

Adds an origin point

Public function

void

 

AddSourceObject

(
    const UObject* NewSourceObject
)

Sets the object this effect was created from.

Public function

void

 

Clear()

Public function Const

FGameplayEff...

 

Duplicate()

Creates a deep copy of this handle, used before modifying

Public function

FGameplayEff...

 

Get()

Returns Raw effet context, may be null

Public function Const

const FGamep...

 

Get()

Public function Const

const UGamep...

 

GetAbility()

Returns the Ability CDO

Public function Const

const UGamep...

 

GetAbilityInstance_NotReplicated()

Returns the Ability Instance (never replicated)

Public function Const

int32

 

GetAbilityLevel()

Returns level this was executed at

Public function

const TArray...

 

GetActors()

Returns actor list, may be empty

Public function Virtual Const

AActor *

 

GetEffectCauser()

Returns the physical actor tied to the application of this effect

Public function Const

const FHitRe...

 

GetHitResult()

Returns hit result, this can be null

Public function Virtual Const

AActor *

 

GetInstigator()

Returns the immediate instigator that applied this effect

Public function Virtual Const

UAbilitySyst...

 

GetInstigatorAbilitySystemComponent()

Returns the ability system component of the instigator of this effect

Public function Virtual Const

const FVecto...

 

GetOrigin()

Returns origin point, may be invalid if HasOrigin is false

Public function Const

AActor *

 

GetOriginalInstigator()

Should always return the original instigator that started the whole chain.

Public function Const

UAbilitySyst...

 

GetOriginalInstigatorAbilitySystemComponent()

Returns the ability system component of the instigator that started the whole chain

Public function Const

void

 

GetOwnedGameplayTags

(
    OUTFGameplayTagContainer& ActorTag...,
    OUTFGameplayTagContainer& SpecTagC...
)

Returns the list of gameplay tags applicable to this effect, defaults to the owner's tags

Public function Const

UObject *...

 

GetSourceObject()

Returns the object this effect was created from.

Public function Virtual Const

bool

 

HasOrigin()

Returns true if GetOrigin will give valid information

Public function Const

bool

 

IsLocallyControlled()

Returns if the instigator is locally controlled

Public function Const

bool

 

IsLocallyControlledPlayer()

Returns if the instigator is locally controlled and a player

Public function Const

bool

 

IsValid()

Public function

bool

 

NetSerialize

(
    FArchive& Ar,
    UPackageMap* Map,
    bool& bOutSuccess
)

Custom serializer, handles polymorphism of context

Public function

void

 

SetAbility

(
    const UGameplayAbility* InGame...
)

Sets Abilit instance and CDO parameters on context

Public function Const

FString

 

ToString()

Returns debug string

Operators

Name Description

Public function Const

bool

 

operator!=

(
    FGameplayEffectContextHandle const ...
)

Comparison operator

Public function

void

 

operator=

(
    FGameplayEffectContext* DataPt...
)

Sets from an existing context, should be allocated by new

Public function Const

bool

 

operator==

(
    FGameplayEffectContextHandle const ...
)

Comparison operator

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss