Call the following function to spawn the actor:
SpawnActor<AMyActorClass>(AMyActorClass, Transform);
This function resides in UWorld
which you can access by calling GetWorld()
from the actor you’re spawning it from.
So for example: GetWorld()->SpawnActor<AMyActorClass>(AMyActorClass, Transform);
Note: you need to include the following file to call this function: #include "Runtime/Engine/Classes/Engine/World.h"
Let me know if this answers your question.