Child exist condition does not trigger for arrays?

i even tried to directly use child “0” and the object is still not created.

1 Like

Did you try
Child Variable(usercount) of scene variable user exist

yes, i did try values (both variable and 0) but gd wants a string as name, and it didnt work.
ToString(Variable()) did also not work.

i have another section with child check that does work however:

the difference is that the one that works is a structure, and the one that does not is an array.

Don’t know if this is correct but it seems to work

thanks, but that isnt what i need.
I only want to check for the childs existence.

for now, i will set the variable user to “n”
and then check for if var user is not “n”

use child of var exist would make it better tho.

Generally speaking, arrays don’t have children - they’re always referenced by position. I suspect, behind the scenes, arrays are stored as a list of pointers, and referencing lists by anything other than position is meaningless.

Whereas a structure is most likely stored behind the scenes as a dictionary, and referencing it’s children does make sense.

If you want to check if the array has a particular entry, it looks like you’ll have to iterate through the array. If you want to check if there are any entries in the array, check the array’s childcount (yeah, I see the irony in that command :confused:, but I don’t see any other way of determining an arrays size)

Unless the array is empty, position 0 is always filled. If you remove array[0], all the other elements are shifted up a position to fill the void:

[0] aaa
[1] bbb
[2] ccc
[3] ddd

remove the first entry, and you get:

[0] bbb
[1] ccc
[2] ddd