[SOLVED] How do I use parameters to set the array for a "for every child" condition?

How do I…

I have a function. The goal is to return the index for a given value within an array. The parameters I use are Array (type: Scene Variable) → the array to search in and the value to look for (“Value”, type Number). I need to use the value of the parameter “Array” within the “for each child” loop. But I cannot find the right syntax. I thought there would be a third option next to GetArgumentAsString() and GetArgumentAsNumber(), perhaps GetArgumentAsReference(), but I did not find anything on this topic.

What is the expected result

I can utilise the parameter within the loop.

What is the actual result

The parameter does not get recognized and the loop does not run at all.

Related screenshots

Under event functions there are 2 actions. One to copy the parameter variable to another variable and one to copy a variable to the parameter variable.
image

example:

debugger: using an array with “Larry, Moe, Curly”
image

Scene Variables: (after)

scene:

Thanks a lot @Keith_1357, that was exactly what I needed! :+1:

1 Like