I created a structure variable containing 15 children, and I’d like it to be removed/hidden from this list when the “doppiodosaggio” variable becomes true, and then recreated as soon as it becomes false again. Is this possible?
Thanks
Hey! You should be able to use this action to delete the child:
Not exactly sure how you could add it back later
I’m not sure I understand. Do you want a child variable that is a structure to be added and removed or the boolean variable? If it’s the structure then is it the entire structure or the contents of the structure.
You can modify a structure. I just don’t know if you should. Variables are delicate. It’s easy to break a variable. Plus, if you remove something and later try to use it GD will create it with a default value.
It might be better to use a boolean variable to create 2 states and then decide if the structure is used or not.
I don’t like to leave something unanswered. So, if it’s the entire structure then you could use Json.
This uses json to copy the structure to a string variable at the beginning. Then you either remove the child or add the child using the Json string. My variable was Test and it had 3 children named One, Two and Three.
This logic is a bit flawed. It will modify the variable when it’s first run using the default value of the trigger variable. You might want to add additional conditions to prevent that depending on your needs.
Hi guys, thanks for your interest, but I didn’t think it was so complicated to hide a child from a structure…
I’m using a single structure variable with a list of powerup text inside, and it doesn’t recognize your “ToJSON(Test.Two)” variable, probably because they’re not structure variables.what I would like to hide is powerup n.0 powerup1
This is my code for generating powerups, where two are randomly selected from the array.
The child’s deletion or hiding must last as long as the variable Attivazione_powerup.doppiodosaggio remains true.







