Spawn Actors inside volume

Hey all Im trying to get make an actor, lets call it “Box Spawner”, to spawn a random amount of actors inside of its designated bounds without overlapping. I tried creating an actor with a box collision thinking that could be used to designate how big the spawn volume would be but that doesn’t seem to be the answer. I am also pretty new to blueprints so I may be on the right track but not know where to go from here.

There is actually a tutorial by Epic Games on how to do just that, here is the link: - YouTube

Thanks Jamendxman!!! I was actually thinking of going thru your zombie tutorial series while I waited for an answer for this thread haha still going thru it after this video thanks!!

Glad to be of help!

Is it possible to run a loop a certain amount of times? I want it to spawn multiple boxes randomly on begin play so what I tried doing was do a forEachLoop before my spawn bricks function and then input an integer variable as the array but that didn’t work.

Nevermind got it to fire multiple times with a WhileLoop

Since the video seems to be removed:

Just create an actor blueprint, add a Box Collision to it, and use the above code. You can also turn the last index value into the number of actors you wish to spawn. Also, set the First Index to 1 if you want it to spawn the exact number otherwise, in this example it will spawn 31 if it’s set to 0.

3 Likes