Actor Prefab Spawn Class Getter
About
Used by the Prefab Reference Component, these overridable objects allows you to control how a prefab actor class is selected when a PRC wants to spawn one.
Built-in classes
Here are the default available class getters, but keep in mind that you can make your own ones by doing BP or C++ subclasses!
> Base Prefab Spawn Class Getter (UPSActorPrefabSpawnClassGetterBase
)
Cannot be directly used. Override this class to handle your project needs.
How to use
Mandatory overrides are GetSoftPrefabClass
(and GetSoftPrefabClasses
if your are a container, see the function declaration).
If you are have bUseAsyncPath
enabled, you have to override AsyncGetSoftPrefabClass
and call the OnAsyncPrefabSpawnClassGetterFinished
delegate. There is no async variant for GetSoftPrefabClasses
because this is only used in editor and not at runtime.
IMPORTANT: bUseAsyncPath
will be skipped if we are in editor OR if we are not doing an async spawn on the PRC. You HAVE to always implement the sync functions for fallback.
To make the editor work properly, you must also implement ClearSoftPrefabClass
(see UPSActorPrefabSpawnClassGetterSingle
and UPSActorPrefabSpawnClassGetterRandom
for examples on how they work).
To get the owning PRC of this getter instance, see the GetLinkedPrefabReferenceComponent
functions.
More details can be found in the source code.
Last updated