referencing a newly spawned actor in the UI

Hi, I am trying to make a tower defense and have it so each tower is upgradeable. I have added the spawn system so it spawns a new instance for each tower in the game and added an interaction system that brings up the stats menu but I don’t know how to reference the variables of the individual tower I am accessing.

For example, I have it set as FireTower but when a new one spawns its
FireTower1, 2, 3, etc. So if I were to change the targeting in FireTower 3 it would only change the original Firetowers targeting and not 3. How would I get a reference to the tower I am interacting with?

thank you,



I notice you have already given the towers IDs. That’s the way. You can know which tower you’re talking to from the ID.

‘Get actor of class’ is no good, because it’s just going to get the first one you spawned. You need to ‘get all actors of class’ and figure out which tower has which ID.

1 Like