Can't fill integer array

Hi, noob question here. I want to fill an empty integer array with 7 random values from 1 to 20. The following blueprint gives me only one index, what am I doing wrong? I can’t fix this no matter what I try, please help

Hello, you need to use the “For Loop” node instead of the “Do N” node. The “Do N” node simple puts a cap on the number of times the following nodes can be executed.

Here’s a picture of the function that will return a new array filled with the random integers:

People coming from C++ would understand that Loops are the way to repeat tasks, but “Do N” is poorly named.

The “0” in RandomIntegerInRange should be a “1”, it’s just a typo

Hope this helps!


Yes it’s working! Do N really threw me off. For Loop is the way to go. Thank you so much for the help!!!

You’re welcome! :smiley: