For each child variable (structure)

New here. I’ve searched for this in forums, Discord, and online but haven’t found a solution yet. I’ve had videos shown me and my events, though seemingly the same, still don’t work. It’s got to be user error. If this problem is solved somewhere, please forgive and point me there. Thanks.

I simply want, on a keystroke, to set all the children (boolean) of a parent structure variable to True, then change one of them to False. This event is part of a larger system, but the hangup seems to be related to this particular function so I’ve isolated it and am trying to solve the issue. I am out of ideas. I’ve attached a screenshot of the events (I created a brand new build to test this).

Any help is appreciated. //Shoutout to @ZeroX4 and @VegeTato for earlier suggestions!

Your expression is wrong. Variable() is for numbers, and to dynamically access a child variable it must be a string. So while it may not be your only problem, you definitely need to use VariableString() within your dynamic variable process. Basically, test[VariableString(Blahblah)] not test[Variable(Blahblah)]

As a note: variable names cannot start with a number. Never start a variable name or child variable name with a number to avoid other issues.

1 Like

Thank you so much!

To be clear, it seems that you’re saying that since arrays use number labels, [Variable()] works and since structures use string labels, [VariableString()] works. Is that the concept?

Regardless, I’m grateful for your response. Today will be a better day. :grin:

I actually can’t remember if atrays need strrings or not when accessed dynamically, but i believe that’d be correct (integer values only for arrays, strings only for structures)