I want to create and update an array of target points. Haven’t gotten the hang of blueprints yet.
I have a target point array variable and one for the target point item which I intend to insert in order to create my array entries. Those are supposed to be updated with individual positions later elsewhere.
Hard to debug for me, but I’m not sure this is working as intended. Can someone look at this and tell if this should be working (it doesn’t, I reckon) or point me to the correct approach?
There are a few Array nodes that are of interest for this. Each one behaves slightly differently. If you hover over them they’ll give you a little description. “ADD” will append the new item to the end of the current array, thereby expanding the length of the array by 1. Insert plops the new one in at the index you are feeding it. So in the example you have above, the loop iteration is the index value you are using (which should be fine). There’s also Set Array Elem which I find very useful because it has a toggle for if you want it to scale the size of the array if there wasn’t an entry there before.
The setup you have depicted should be starting a loop from index 1 (you may want to try “0”, I don’t remember if UE4 has zero as the first slot or if it’s 1). It is then loops how every many time large “Squad Size” is. Then it’s feeding Slot Item into the Slot Position Array.