Efficient way to add multiple inputs into an array?

I know there has to be an easier way because this is just copying and pasting to brute force the result. I’m sure there is a node that would solve the issue but as of yet it’s eluding me. A loop of some kind would work but I don’t know how you would add incremental growth to the transform variable.

What I’m trying to achieve is essentially an actor that spawns multiple tiles from it’s origin position with a gap in between each at a set increment.

Essentially a match 3 style game in the end, but for now I’ll settle with just getting tiles to do what I want them to do first.

Any input would be appreciated.
Thanks for any time on the matter.

Derek.

Well, I don’t know exactly what you want your spawn results to look like, so this might not be perfect. But what about something like this?

The For Loop (not to be confused with For Each Loop, in this case) lets you set a start index and an end index, which you can then use during each iteration to multiply your offset (gap) to get locations that are closer/farther from the start location.

If you indeed do need to actually fill an array with these transforms, you could drop in an add-to-array node (like you used in your own screenshot) before the spawn actor node.

From here, you can build up your graph to make it more complex, because this example only spans a single direction, but I hope at least this helps you see a more compact way of generating your spawn locations.

I’m thinking I would need it to be arrays as I would need to slots filled by the other tiles as they’re matched and subsequently destroyed. I would think this easier/possible with just swapping the index entries as they’re destroyed and replacing the empty index top down.

Will give a few tries one way or another over the weekend.

Think you’re right though that I can just have the add shenanigans in a for loop with a limited index. Think I was too caught up on the for each loop node because it dealt with arrays.

shrug