UMassRepresentationSubsystem::GetOrSpawnActorFromTemplate

Get or spawn an actor from the TemplateActorIndex

Choose your operating system:

Windows

macOS

Linux

References

Module

MassRepresentation

Header

/Engine/Plugins/Runtime/MassGameplay/Source/MassRepresentation/Public/MassRepresentationSubsystem.h

Include

#include "MassRepresentationSubsystem.h"

Source

/Engine/Plugins/Runtime/MassGameplay/Source/MassRepresentation/Private/MassRepresentationSubsystem.cpp

Syntax

AActor * GetOrSpawnActorFromTemplate
(
    const FMassEntityHandle MassAgent,
    const FTransform & Transform,
    const int16 TemplateActorIndex,
    FMassActorSpawnRequestHandle & SpawnRequestHandle,
    float Priority,
    FMassActorPreSpawnDelegate ActorPreSpawnDelegate,
    FMassActorPostSpawnDelegate ActorPostSpawnDelegate
)

Remarks

Get or spawn an actor from the TemplateActorIndex

Returns

The spawned actor from the template actor type if ready

Parameters

Parameter

Description

MassAgent

is the handle to the associated mass agent

Transform

where to create this actor

TemplateActorIndex

is the index of the type fetched with FindOrAddTemplateActor()

SpawnRequestHandle

[IN/OUT] IN: previously requested spawn OUT: newly requested spawn

Priority

of this spawn request in comparison with the others, lower value means higher priority (optional)

ActorPreSpawnDelegate

is an optional delegate called before the spawning of an actor

ActorPostSpawnDelegate

is an optional delegate called once the actor is spawned