Hide() and Show() not working for non-child nodes

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

Ok, so I has a hierarchy like this:
Map–V
->Map_Geo
->Map_Counties
->Map_Culture
->Panel—V (has my sript)
------------->Enter (On click condition)
->Heraldics_of_counties

Thing is A.hide(), A.show() is working well with other stuf (for child nodes)
It doesn’t work for path nodes:

func EnterLand():
var B1 = $“/root/Map/Map_Geo”
var B2 = $“/root/Map/Map_Counties”
var B3 = $“/root/Map/Map_Culture”
var B4 = $“/root/Map/Heraldics_of_counties”
print(B1,B2,B3,B4)
B1.hide()
B2.hide()
B3.hide()
B4.hide()

func _on_Enter_pressed():
EnterLand()

I was trying to check if something is wrong with a script but as I see from print I get the right nodes:

[Sprite:1303][Sprite:1304][Sprite:1305][Control:1342]

So I can not use hide(), show() for non-child nodes? Since I tried it and it works well if I lunch it from Map’s script (which is my main root).

Also, I wanted to ask if this engine has data analitic functions? Since I’m a Math student I see it as super tool to show data and so on… If it does have something similiar like R does for plots or calculations that would become top tool.

And thanks for all help I might get :slight_smile:

If I’m not mistaken, the draw function is only called on nodes in the scene tree. Consider adding your “path nodes” to the hierarchy via parent.add_child(node_you_wish_to_add) (or add_child(node) in the parent node’s script.)

DDoop | 2020-06-26 20:56