How to reference an actor that spawns another actor?

Does anyone know how I can get a reference to the actor responsible for spawning another actor? I see the owner and instigator inputs on the SpawnActorByClass node but how do I retrieve this data from the begin play of the spawned actor?

Hey @Nortksi!

So it depends on WHY you need to know what spawned the new actor, but you can use “Get Owner” and “Get Instigator” to get the actor that is passed into the SpawnActor node immediately upon spawn.

Owner just returns the actor and takes any actor as the owner.

Instigator has to be a pawn or a child of pawn (so character etc works). This will be a player or AI almost always.

So if it were a gun spawning a bullet, “Owner” would be the gun actor and “Instigator” would be the cowboy.

image

Hope this helps! :slight_smile:

1 Like

Perfect thanks!

I did try searching for Get Owner but it wasn’t there as I was trying to find it from the Begin Play pin, I just needed to right click to find it :slight_smile:

1 Like