Lets say I have two objects “NewText” and “NewSprite”.
The “NewSprite” has variable:
At the beginning of the scene, I want to change the text of the “NewText” to the “color” variable of the “NewSprite”. I tried this:
but it doesn’t work as I expected. The “NewText” give me the output “0” instead of “white”. Why is that?
The expression-editor generates the wrong code (or the code is not processed correctly.)
Workaround: Replace ToString(NewSprite.Variable(id)) with NewSprite.VariableString(id).
I had the same problem, it would be great if someone could fix it.
The “object.VariableString()” works flawlessly.
It’s already been fixed, and should be included in the next release: String and number object variables both have same name · Issue #4223 · 4ian/GDevelop · GitHub