Best Way to Spawn Chunks of Actors Continually
If I've got 7 10x10x10 blocks or chunks of space (7 blueprint classes) each with multiple actors with their own event components, what is the best way to spawn them next to each other continually, randomly placing either 1-7 until a target point is reached? Say, all of them being spawned in the x-coordinate direction.
Event -> Randomly GetActorClass (1-7), spawn at point zero -> delete after time again --> Randomly choose then generate ActorClass 1-7, at spawn point + 10 coordinates in x-direction (next spot after spawn point zero) --> delete after same time limit etc. ?
What nodes would be good for setting the spawn of which chunk of space (1-7) randomly? I can deal with the placing of the actors, just am unsure of whether an index and how to set that to randomly choose which actor 1-7 to place, or some other type of getActorByClass -- sorting the 7 areas of space Any advice would be greatly appreciated, thanks.
Create an integer array variable and set its elements to 1-7 at the beginning of each calculation then shuffle it with the "shuffle" node. You can then use a foreach loop and get a random number between 1 and 7 without any repetition concerns.
answered Oct 23 '15 at 11:14 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here