How to make actor spawn copy of itself?

How do I make an actor spawn another copy of itself using Blueprint?

Currently I use GetClass to get the class of my actor, cast that to an actor class, and feed that into SpawnActor. This produces various strange affects. Another question (Spawning a new actor of the same class infinite loop Solved! But i have another problem with collision of pawn - World Creation - Unreal Engine Forums) suggests this is not possible.

As a work around, I tried creating a new blueprint class called Spawner with a function called RequestSpawn that takes its arguments and calls SpawnActor using those arguments. This doesn’t work either.

Can someone describe how to have an actor spawn another instance of the same class or show a blueprint for that? If (Spawning a new actor of the same class infinite loop Solved! But i have another problem with collision of pawn - World Creation - Unreal Engine Forums) is correct, then I guess some work around is necessary.

Thanks,
-X

+1, I also would like to know that.

I had no problems getting a Blueprint actor to spawn another actor of the same class in reaction to an event.

Your problem appears to be that spawning the new class instance triggers the same event causing another actor to be spawned and so on. An infinite loop, pretty much.

You could fix that by changing the spawn position to not immediately overlap with the actor who entered the trigger box. Or you could start with collision disabled and only switch it on after a delay. Basically, you need to make sure that spawning the actor will not immediately trigger the spawning event.

1 Like