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 ^_^
asked Apr 08 '14 at 05:50 PM in Blueprint Scripting
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here