This has been killing me for two days so I finally decided to post my problem here. I am spawning an actor into the world at a random spawn point. Then when I press the space bar, I want to destroy the actor and have it spawn at another random spawn point. I have this part down, but THE PROBLEM IS THAT I CANNOT FIGURE OUT HOW TO MAKE SURE THAT THE ACTOR DOES NOT SPAWN AT THE SAME POINT TWICE IN A ROW. I have read that I should use arrays but i am really having trouble figuring out how to get it to work.
Anyways, here is my setup so far.
In the game mode on event begin play: “Spawn Washer” is called and it selects a random “washer spawn point”, where it calls another event called (also called “spawn washer”) that is located inside the spawn point blueprint.
Finally, inside the actual actor “The Washer”, when I press space bar, it destroys the actor, casts back to the game mode and calls the original spawn washer event (See first pic).
Once again, I just want to prevent the actor from spawning at the same point twice in a row. Any help would be greatly appreciated, and I apologize in advance for the NOOBOSITY of my question!
You want to save your random number in “This Spawn Number” and then check that against “Last spawn number”(default to -1 so 0 has a chance to win). “Last Spawn Number” will be set with “TSN” if the numbers are not the same. On the second, third, etc., run if the random number is the same as the last spawn it will loop again until it does not.
Whups yeah little oversight from me switch the Counter with the Length keep the > node as is. (or keep the < but then you have to switch the true/false ;P)
Make sure you dont already have placed what you want to Spawn in the Level. Its a good habit to use TargetPoints / Tags or a combination of the two for this. If you still experience double Spawns make sure you removed your old Spawn Code. The way I set it up makes sure that the Old Spawn gets destroyed but it won´t affect anything already placed in the Level by Hand.