Blueprint Array Spawner - Math help

Hey everybody,

I am working on a cloner of sorts to spawn an array of actors.

I have the basic concept in my head ready, here is an example of a basic array of 4 objects with 500-units gap in between,
they spawn across:

I need help regarding the math of keeping the array centered to the middle of the screen, meaning the Y values should be:

Or another example an array of 5 with gap of 1000, should be

Instead of how it is right now which is 0,1000,2000,3000,4000

I’m sure there is a way to calculate it automatically but I couldn’t figure it out.

Thanks in advance


You could math it out, sure. But you can also:

This will be smack bang at the provided Center Location (with an optional offset if necessary) with spacing defined by Sector Size.
Or, the more traditional way:

EDIT: thank you ! I think when checking this the traditional way might be better, since I want to have the option to modify the spacing with a controller, so your solution gives me the option to do that :slight_smile:

thank you so much!

It would work with both - plug your variable into Sector Size.

Great solution - works perfectly

Thanks again