![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | potatobanana |
how to get child of my node? without child name?
for example i have
parent button
child label
how can i get child node?
i do like this and did’t work
func _on_Button5_pressed() -> void:
for child in get_children():
if child is Label:
child.set_text("teesttts")
The code seems fine to me
But this might help debugging it
func _on_Button5_pressed() -> void:
print("Pressed signal is detected")
printt("Check if this have any children at all", get_children())
for child in get_children():
if child is Label:
printt("If this isn't called, none of the child is a label")
child.set_text("teesttts")
LoneDespair | 2021-02-23 17:33
The script is on the button, right?
exuin | 2021-02-23 17:52