Using a for loop with a number of triggers

Is it possible to create a number of triggers and then use a for loop to select through them, referencing them by the index number? Or use a random integer to select a trigger. I want to spawn objects randomly from about 10 points at different times. Should i even use triggers for this? Thanks :slight_smile:

Hey KaladinRahl,

I would have to ask. What is the Triggers for? Initializing the spawn or does it have an effect on the location where the objects randomly spawn?

Peace

Initializing the spawn.

So once the player enters a trigger volume, you then want to spawn Objects around the area of the player. You also say at different times, so did you want this to be sequential or randomly after the time they enter the volume.

sorry, i read your question wrong. I am using them for the location of where they spawn. I want the a random amount of objects of varying quantity to spawn within a certain time frame, say 10 seconds, but at random times during that time frame until they have all spawned.

My suggestion is using the Get All Actors of Class node and then pull out the Trigger class you used. Use a ForEachLoopWithBreak node and that will get you the Triggers. Break when you want to stop. If you want it to be random, you can use the Length array node, link that to Random Integer node. Link that Get array node and get Actors Location node then spawn the others Actors from there.

Here is a quick snippet from my Spawn Player Blueprint Function.