How would I add a value to each element making it larger based on Array size?

Have a foreach loop on an array and would like to have a variable incremented for each individual array element but can’t figure out where to do this at. When attempting to do it in the foreach loop it does to each item in the array. How do I go about adding a value to each element making it larger based on the array element.

Let me see if I understadn your question:
Case1:
You have an array of n elements. YOu are doing a for-each on this array. You want to increment a varibale (whcih is not a memerb of the array)in each loop iteration?

If this si your question, you can create an Int variable. Within the loop body, add 1 to this variable.

OR
Case2:
In each iteration you want to increment the array element in taht iteration.
eg:

before:
[1, 3, 5, 6, 9]

after:
[2, 4, 6, 7, 10]

In this case you must add 1 to the curernt elemnt in question. You will get this as an output pin in the for-each loop.

Sorry if I mis-undertood.

Are you talking about the Array Index int pin on the foreach block?

To clarify, say I have 5 elements in my array and am updating them in the foreach loop. One of the values is location. I want to within the loop have the value larger.
So element 0 will be at 10, element 1 will be at 20, element 2 will be at 30 and so on.

From the foreach loop pulling from the array index pin did what I was looking for, thank you mindfane :slight_smile: