I’m having a strange issue when trying to spawn an actor on overlap with another actor. I have a box component set to trigger overlap events with the player and on that overlap event, the actor should spawn another one of itself in a random location designated by an array of spawn point actors that I made and then destroy itself. The problem is, sometimes the actor creates a second actor in the same location as itself despite me having checks to make sure this won’t be the case. I have a variable that stores the spawn point actor that the current actor was spawned at and when selecting a new spawn from the array it checks to make sure it isn’t the same. If it is, it tries again. I have a debug message set to print “double” if it is the same location. Sometimes this gets triggered, sometimes it doesn’t. I also have a bool that ensures the overlap can only be triggered once. Finally, I have debug messages set to display the vector location of the actor when it spawns (blue) and when it has an overlap event triggered (purple) so I can check the location of new actors against the triggered one. Somehow, despite all this, I still get instances of a new node being placed exactly where the old one was.
As well as a significantly stranger occurrence of this happening on top of a double message
Any help figuring out what’s wrong would be greatly appreciated!!!
Also, here is the actor in question’s blueprint