UGameplayBehavior

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

GameplayBehaviorsModule

Header

/Engine/Plugins/Experimental/GameplayBehaviors/Source/GameplayBehaviorsModule/Public/GameplayBehavior.h

Include

#include "GameplayBehavior.h"

Syntax

UCLASS(Abstract, Blueprintable, BlueprintType)
class UGameplayBehavior :
    public UObject,
    public IGameplayTaskOwnerInterface

Variables

Name Description

Protected variable

union UGameplay...

 

@11308

Protected variable UProperty Category, EditDefaultsOnly

FGameplayTag

 

ActionTag

Tag identifying behavior this class represents

Public variable

uint32: 1

 

bFinishedCharacter

Public variable

uint32: 1

 

bFinishedGeneric

Public variable

uint32: 1

 

bFinishedPawn

Protected variable

uint32: 1

 

bTransientIsActive

Protected variable

uint32: 1

 

bTransientIsEnding

Protected variable

uint32: 1

 

bTransientIsTriggering

Public variable

uint32: 1

 

bTriggerCharacter

Public variable

uint32: 1

 

bTriggerGeneric

Public variable

uint32: 1

 

bTriggerPawn

Protected variable

EGameplayBehavi...

 

InstantiationPolicy

Protected variable

FOnGameplayBeha...

 

OnBehaviorFinished

That it's not going to be called if the behavior finishes as part of Trigger call

Protected variable UProperty Category, EditAnywhere BlueprintReadWrite

TArray< AActor ...

 

RelevantActors

It's up to the behavior implementation to decide how to use these actors.

Protected variable UProperty

AActor *

 

TransientAvatar

Used mostly as world context for IGameplayTaskOwnerInterface function.

Public variable

uint32

 

TransientProps

Protected variable UProperty Transient

AActor *

 

TransientSmartObjectOwner

SmartObject Actor Owner, can be null

Constructors

Name Description

Public function

UGameplayBehavior

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

AbortBehavior

(
    AActor& Avatar
)

Public function Virtual

void

 

EndBehavior

(
    AActor& Avatar,
    const bool bInterrupted
)

Public function Const

AActor *

 

GetAvatar()

Public function Virtual Const

TOptional< F...

 

GetDynamicLocation

(
    const AActor* InAvatar,
    const UGameplayBehaviorConfig*...,
    const AActor* InSmartObjectOwn...
)

Can return (it's optional) a dynamic location to use this gameplay behavior

Public function

FOnGameplayB...

 

GetOnBehaviorFinishedDelegate()

Public function Const

bool

 

IsInstanced

(
    const UGameplayBehaviorConfig*...
)

Returns true if this behavior instance is either a non-CDO object or is a CDO, but the class is intended to be used via its instances.

Public function UFunction BlueprintCallable, Category, Meta

void

 

K2_AbortBehavior

(
    AActor* Avatar
)

Public function UFunction BlueprintCallable, Category, Meta

void

 

K2_EndBehavior

(
    AActor* Avatar
)

Public function Const UFunction BlueprintCallable, Category, Meta

int32

 

K2_GetNextActorIndexInSequence

(
    int32 CurrentIndex
)

Public function UFunction Category, Meta, BlueprintImplementableEvent

void

 

K2_OnFinished

(
    AActor* Avatar,
    bool bWasInterrupted
)

Public function UFunction Category, Meta, BlueprintImplementableEvent

void

 

K2_OnFinishedCharacter

(
    ACharacter* Avatar,
    bool bWasInterrupted
)

Public function UFunction Category, Meta, BlueprintImplementableEvent

void

 

K2_OnFinishedPawn

(
    APawn* Avatar,
    bool bWasInterrupted
)

Public function UFunction Category, Meta, BlueprintImplementableEvent

void

 

K2_OnTriggered

(
    AActor* Avatar,
    const UGameplayBehaviorConfig*...,
    AActor* SmartObjectOwner
)

BP API.

Public function UFunction Category, Meta, BlueprintImplementableEvent

void

 

K2_OnTriggeredCharacter

(
    ACharacter* Avatar,
    const UGameplayBehaviorConfig*...,
    AActor* SmartObjectOwner
)

Public function UFunction Category, Meta, BlueprintImplementableEvent

void

 

K2_OnTriggeredPawn

(
    APawn* Avatar,
    const UGameplayBehaviorConfig*...,
    AActor* SmartObjectOwner
)

Public function UFunction BlueprintCallable, Category, Meta

void

 

K2_TriggerBehavior

(
    AActor* Avatar,
    UGameplayBehaviorConfig* Confi...,
    AActor* SmartObjectOwner
)

Protected function Virtual Const

bool

 

NeedsInstance

(
    const UGameplayBehaviorConfig*...
)

Public function

void

 

SetRelevantActors

(
    const TArray< AActor* >& InRe...
)

Public function Virtual

bool

 

Trigger

(
    AActor& Avatar,
    const UGameplayBehaviorConfig*...,
    AActor* SmartObjectOwner
)

Default implementation will trigger the appropriate Blueprint event based on their presence in the script and in the following priority:

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Overridden from IGameplayTaskOwnerInterface

Name Description

Public function Virtual Const

AActor *

 

GetGameplayTaskAvatar

(
    const UGameplayTask* Task
)

Get "body" of task's owner / default, having location in world (e.g. Owner = AIController, Avatar = Pawn)

Public function Virtual Const

uint8

 

GetGameplayTaskDefaultPriority()

Get default priority for running a task

Public function Virtual Const

AActor *

 

GetGameplayTaskOwner

(
    const UGameplayTask* Task
)

Get owner of a task or default one when task is null

Public function Virtual Const

UGameplayTas...

 

GetGameplayTasksComponent

(
    const UGameplayTask& Task
)

Finds tasks component for given GameplayTask, Task.GetGameplayTasksComponent() may not be initialized at this point!

Public function Virtual

void

 

OnGameplayTaskActivated

(
    UGameplayTask& Task
)

Notify called after GameplayTask changes state to Active (initial activation or resuming)

Public function Virtual

void

 

OnGameplayTaskDeactivated

(
    UGameplayTask& Task
)

Notify called after GameplayTask changes state from Active (finishing or pausing)