Error : get_node: Node not found: BG/TextLabel. [label]

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

I just want to set text , but I encounter this error first.
I think the code was correct , but I have no idea , how this happen?

my tree
-Dialog
|-BG
-|-TextLabel

This is the code.

self.get_node("BG/TextLabel").text = "omg hax"

Error

get_node: Node not found: BG/TextLabel.

this can happen before _ready() is called.
did you use export var for setting message?
can’t say what exact problem is with just 1 line of code.

volzhs | 2021-01-20 20:07

Where is the script attached?

WayfairSalesRep | 2021-01-21 02:24

WayfairSalesRep -Dialog

nineret | 2021-01-21 02:41

:bust_in_silhouette: Reply From: Andrea

who is self?
get_node is likely not pointing to the correct address, try with “/root/Dialog/BG/TextLabel”