Topic was automatically imported from the old Question2Answer platform.
Asked By
FinFan
Hello guys!
I have ugly code:
var explabel = get_parent().get_parent().get_parent().get_parent().get_parent().get_parent().get_node("CenterPanelContainer/CenterBoxContainer/ExperiencePanel/ExperienceBox/LabelValue")
It’s work, but it’s ugly! >.< my eyes bleeding whe i see it.
One way is to add a script to the parent node of CenterPanelContainer and RightPanelContainer nodes, pass a reference to this parent to AdvantageB node when initializing and have a method in the parent node that returns the ExperienceBox/LabelValue
Another way is to declare a signal and emit it from AdvantageB node when experience label needs to be update it and and connect the experience node to listen to the signal events