How do I display a player property in a text box?

I am trying to display a player’s (sprite angle) property on the game UI as a readout. Have tried various approaches to properly reference the “Angle” property of the player’s sprite object (player object is named ‘Player1’). Can’t get the text box to display the proper readout.

My most recent approach was to ‘Always’ update a text box using the ‘Modify the text of a text object’ by setting the text object ‘= (set to)’ text of…

“ToString(Variable(Player1[“Angle”]))”

This didn’t work. I think I’m referring to the Angle property of the Player1 sprite object wrong. Doesn’t create an error, just won’t show the correct value.

Can somebody direct me to the correct way to display this property in a text box? Thanks.

There are several different angles. You can access them using the blue Expressions button (sigma symbol).
The basic orientation angle would be something like: Do = Player1.Angle() to the text of…
Cheers.

OK. Finally got it to work. The correct syntax was…

“Do = ToString(Player1.Angle())”

Thanks for the tip!

2 Likes