I'm trying to hide a Node2D , what's wrong?
get_tree().get_root().get_node("MainScene2D").get_node("HUD").hide()
but even
get_tree().get_root().get_node("MainScene2D").get_node("HUD").visible = false
No errors but nothing happens
@RAMupgrade said: The correct syntax is: get_node("HUD").set_visible(false) Always check the docs and double-check your spelling! https://docs.godotengine.org/en/stable/classes/class_canvasitem.html?highlight=set_visible#class-canvasitem-property-visible
@RAMupgrade said: The correct syntax is: get_node("HUD").set_visible(false)
Always check the docs and double-check your spelling! https://docs.godotengine.org/en/stable/classes/class_canvasitem.html?highlight=set_visible#class-canvasitem-property-visible
Thanks very much but to be honest the godot docs is not so clear :) or it is just me :)
get_tree().get_root().get_node("MainScene2D").get_node("HUD").set_visible(false)
however doesn't work. It is still visible
@RAMupgrade said: @"K-Storm-Studio Ltd" The docs are TOO clear, so it's really confusing! It just takes time to understand the format and language. ;) I'm not sure why your node is still visible but someone else may have ideas. It would help to provide a screenshot of the project layout and some more of the code. Then it's easier for other people to figure out what's happening. Otherwise we're mostly guessing. Good luck!
@RAMupgrade said: @"K-Storm-Studio Ltd" The docs are TOO clear, so it's really confusing! It just takes time to understand the format and language. ;)
I'm not sure why your node is still visible but someone else may have ideas. It would help to provide a screenshot of the project layout and some more of the code. Then it's easier for other people to figure out what's happening. Otherwise we're mostly guessing. Good luck!
ok I do thanks :)