Dinamically calling parent variable for a extension

Creating a single structure like Data that holds everything can simplify things like saving/loading by being able to load/save just 1 variable.

If it helps, you could pass the scene or global variable to the function as type variable. You could then copy the variable to an extension variable and use the value of another parameter to select children variables.

https://forum.gdevelop.io/t/not-a-bug-variable-parameter/65018/2?u=keith_1357

You could pass the variable and the child’s name to the function and the function could do something or if it’s an expression, it could return a value. Or it could modify the extension variable and then copy that variable back to the variable selected by the parameter variable.

1 Like