Actors are spawning in a 'star' formation

Hey, so I originally was following this tutorial.
In it, the creator has NPC’s spawning in a group with each NPC right beside each other, which is what I’m looking for.
However when recreated I get spawning in a ‘star’ formation when the amount of spawned actors exceeds 20 or so.


My blueprint is the exact same and I can’t figure out why I get different results.

Im using 4.25
All I want is for the group of NPC’s to spawn together and not in this star/ asterisk pattern.

Does anyone know why this is happening or what I could do to fix it?

I think you need to make your own function that calculates spawn points.
One you are using currently spawn dudes in circles (rotates spawn point around 45deg).
That is why you get star formation when you spawn further from middle.

Make new spawning function.

1 Like

You are not moving the spawn-location, the position of the spawned object are just moved because they collide with each other.
Pretty much a random result.

A better way would be to move the location of the transform.
Make it as close to a square as possible by taking the ceil of the root of the spawn-count (3 if you spawn 9) (save it as a local variable (C)
Then take the index of the for-loop, mod with C to get the column-index. Add this number (times the offset size) on the X-axis
Then take the index of the for-loop, divide with C to get the row-index. Add this number (times the offset size) on the Y-axis

That would move the spawn-point in world-space for each iteration of the for-loop

1 Like

thanks guys! very helpful!