Help me please. how to connect label and var. Very necessary

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Time of creat

I need to connect a variable with a label text. I used + for this, but it did not work. help me please

What’s in the variable (a string, an integer, an object, ??). What was the result of your attempt? An error? If so, post the error text.

Also, posting the relevant code will help us better understand the issue…

jgodfrey | 2020-06-09 15:53

:bust_in_silhouette: Reply From: jtarallo

I leave you a bit of code which should help.
If you have doubts regarding the code, here is more info on setters and getters:

# with this setup, whenever you do self.labelText = "SOME_TEXT", 
# your label will update with that text. It'll also work if you
# set the labelText var from some other object/script

var labelText = "" setget setLabelText
onready var label = $Label

func setLabelText(text):
    labelText = text
    label.text = text