How to toggle invisibility for a texture rect? (or make a proper dialogue box)

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

I have made a dialogue box, that shall pop up if the player wants to interact with an npc. I simply attached a control node to the player, added a canvas layer and put a Texture rect into the canvas. But now it stays visible persistently, even if I toggle invisibilty in the editor.
Is this the wrong node type or am I missing something?
I can’t make the texture disspear.
If there are better approaches, I am open for advice.

It should disappear when you toggle visibility. Can I see the node hierarchy and what node you’re toggling?

exuin | 2021-04-06 17:40

:bust_in_silhouette: Reply From: Lopy

When you run your game through the Editor, a “Remote” tab appears above the scene tree view. You can use it to easily inspect what is happening in your Scene.

Note that while the “hidden” property of CanvasItems and derived classes is inherited from parent to child, a non-CanvasItem in the chain will break it (like in: Button parent of Node parent of Button).

If you really can not get the visible property to work, you can try setting the modulate property to a color with 0 in opacity.