New update expression to call structure variables, unexpected behavior

Seems like if I have a global variable called

Players.Player (Content of the variable: Child “Attributes”)

And another called

Player (Content of the variable: String “Player”)

I tried but I could not get to acess:

Players[Player].Attributes

Seeing at the debugger, seems like Player returns 0, because I have noticed a unknown variable called Players.0.Attributes

Recap:

Using Players[GlobalVariableString(Player)].Attributes I can access the intended child.

But Players[Player].Attributes returns a unknown variable.

1 Like

I think it assumes im trying to call an array because of the [ ] but it can be fixed by making the engine check if the Player variable type is numeric or string before returning its value. (?)

1 Like

Thanks for reporting this!
Can you try to do Players["" + Player].Attributes to see if this works, by “forcing” the expression inside the brackets to be understood as a string, instead of a number?

2 Likes

Yes, it works fine when doing [“”+Player]