How do I get the values from a child of an array variable indexed from another variable inside a function with the array variable as a parameter

I want to make an object behaviour for a grid tile that, when created, changes its animation to the number defined within a variable array that contains the type of each tile. but I cant code with the array variable because it is not technically a part of the function. here is the code of the function, please help

That’s a very inedible sentence for the title - i needed to read it a few times - This is a guess - I was just about to try it…and then thought better of it! …does the array variable need to be inside a ‘Variable()’ too?? or perhaps it doesn’t like the space in ‘grid values’? or you need to select ‘string’ instead of variable. I’m starting to take wild swings at it now! I’m just going to go back to the title sentence and hold my nose and repeat it in a robot voice until inspiration strikes…nope …that didn’t help so im off!

how do I make the red part not red anymore (I did see the varable typo and fixed it, but it’s still red)

You can declare variables inside the extension and create functions to access their values.

I found out that object instances are selected on creation and ditched the function approach, so I don’t need help anymore, but for anyone else reading this with a similar problem, can you please elaborate

I think what he was suggesting is that you could create an array within the extension. Then you wouldn’t need to access a scene variable.

Extensions can have scene and global extension variables. You access them inside an extension just like any other variable.

You would need to use functions to get/set the values of the array.