Im having some trouble wrapping my head around this.
I have an actor. Call it ActorMan.
Actorman contain a variable. Lets call it Name. The name variable is a name. When the actor is spawned it sets the name of the name.
I want to do a check to look what all currently spawned actors name variable are… and if it finds that the current name is already used… it must destroy itself.
I tried using a for each loop. But the results are confusing.
Basicly what i want to achieve is, if 2 actors have the same variable, they must both be deleted.
I managed to create a solution.
What i ended up doing was add every spawned object into an array. And remove it from the array where applicable.
Occasionally in the other Actor BP i would do a get reference to self then set the object variable to itself and then search the array for the actor to delete.
If anyone ever has something similair and would like more clarification i can sit and take some screenshots to explain better.
WHat it basically created was a waypoint system based on where you click. Click 1 = Waypoint 1, then waypoint 2, but if u deleted a waypoint it subtracts.