Showing a variable in my GUI

I have a money counter I want displayed in the corner of my screen; how to I make it so that it can display a variable that will be updated constantly.

You need to create text node in your gui and just use set_text function to update your text.

gui.set_text(gui.get_node("Your Text Node Name"), tostring(variable))

To update it constantly you can put this code into update function, but it might be not good idea depending on your game itself.

2 Likes

Documentation:

Note: There’s also the label component (for use as a text attached to a game object):