array issue

I’ve set up 17 arrows in a blueprint. 1 to 16 assigned to a array variable for spawn items in 16 different locations. but 1 arrow is not included in the array variable. But the out come that arrow also spawning items. what is the problem with my codes?


You need to use “last index” rather than “length” for the max of your random float in range. The last index is the last index you can look up.

The only difference is that an array with 1 item has a length of 1 but a last index of 0. So length is always +1.

Also on your random 1-3 int for number of houses, technically if you want the possibility to only have 1 house, you should have the min be 0. With 1, it will actually run once. Once for 0, then for 1.

Thank you!!!