Syntax of variable within expressions

Another question about syntax.

Trying to get a scene variable (“Test”) to be called within a object (“Object”) variable expression to be displayed on a text box.
The Test variable has a value of ‘X’.
The Object has a variable called ‘X’ with a value of ‘Success’.

I cant get the expression to work, despite trying every variety that i can think of. It should output “Success”

Currently I have set to Object.VariableString(VariableString(X))

Don’t you want Object.VariableString(VariableString(Test))?

That wouldn’t work anyways, as Object.VariableString excepts a variable name as parameter, not an expression. The text is therefore used directly as a name and not parsed as an expression.

Ah, correct. I didn’t have a GDevelop environment handy to test it out first :disappointed:

It will work if you set up an object variable structure:

and reference it ilke:

image

1 Like