UMassRepresentationProcessor::GetOrSpawnActor

Returns an actor of the template type and setup fragments values from it

Choose your operating system:

Windows

macOS

Linux

Override Hierarchy

UMassRepresentationProcessor::GetOrSpawnActor()

UMassCrowdRepresentationProcessor::GetOrSpawnActor()

References

Module

MassRepresentation

Header

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

Include

#include "MassRepresentationProcessor.h"

Source

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

Syntax

virtual AActor * GetOrSpawnActor
(
    const FMassEntityHandle MassAgent,
    FDataFragment_Actor & ActorInfo,
    const FTransform & Transform,
    const int16 TemplateActorIndex,
    FMassActorSpawnRequestHandle & SpawnRequestHandle,
    const float Priority
)

Remarks

Returns an actor of the template type and setup fragments values from it

Returns

the actor spawned

Parameters

Parameter

Description

MassAgent

is the handle to the associated mass agent

ActorInfo

is the fragment where we are going to store the actor pointer

Transform

is the spatial information about where to spawn the actor

TemplateActorIndex

is the index of the type fetched with UMassRepresentationSubsystem::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