Help me access variables across multiple child actors

Hi,

I have room generation via GeneratorBP. It Generates Rooms, one of them is Room1BP which contians enemies which are child actors of Room1BP. Specificaly:

Room1BP > child actor = SpawnerBP which spawns EnemyBP.

Screenshot_1

How can I access Room1BP variables and change them from EnemyBP?

This is what I have so far but it doesn’t work.

Also tried get actor of class Room1 but all other generated rooms change variable for the first room I entered.

Hey there @Saiphe! Welcome to the community! So just to clarify what’s going on, you’ve got a generation system going and are spawning different BPs for each of the rooms right?

Then what we’re looking at is just Room 1’s BP and not a “Master BP” that is the parent class of all of the rooms?

Are the skeletons still children of the room they spawn from? Is that room a child of a big Room pool? If so when you call to cast to the room all rooms with Room1BP will set it. If you want the specific actor you could try using the get parent actor node from the skeleton, and then call to that specific room1BP
image

Still, this is all conjecture without seeing the whole system at play. In situations where I have to spawn enemies under a generated system, I either make the enemies entirely self sufficient and the room just keeps track of who it spawns, or If enemies are never independent of rooms, then when they are spawned, I’d set the variable for their room inside them to be iterated on there when they spawn.

Save yourself the trouble and use gameplay tags.
Create them for each actor to include the room name so you can then select all the actors in a room in maybe 20 seconds of coding …