Structure Variable not adding for all child variables

Please correct me if im wrong, but im 99% sure this is how it used to work…

Lets say i have a Structure called “ItemCount”, and then the child variables “Item1”, “Item2” and “Item3”.

All items are “Number” variables.

If instead of typing “ItemCount.Item1” “add” “100”
I were to type “ItemCount” “add” “100”

Then all child variables would have 100 added to them, correct?

Im almost certain this worked before, but now it dosent.

If i type “ItemCount”, it still registers as an Ok variable, meaning it wont go red text, but adding does nothing to the variables.

Wait…i think i just miss understood how the structure works…

I just tested some more and if i try to change the value by only typing the first half, like “Itemcount” and then change it, it will reset all child variables to 0.

Think i must of used to reset before and got the assumption i could change all child variables that way…

Should i delete the post or leave it in case someone might make the same mistake?

You might want to change the section name. I don’t believe it’s a bug. Otherwise, I think it could be a helpful discussion. I think variables are are tougher concept for new users. They’re not as user friendly.

You might of been thinking about object variables or maybe an extension.

Using just the parent or structure part without the children can break or reset a variable. You could probably do it with a for each child.

I decided to try adding 100 with a for each child. Easy enough. I used the same button but made 2 separate event groups for clarity.

You could also use a repeat with a variable. Be careful with this version because if a child doesn’t exist GD will create one. You could check if the child exists first.


Edit: I redid this because I had the counter +1 in the event that checked if the child exists. So, it would only increase if it existed.

Scene variables

1 Like