How do I toggle whether a character is visible or not?

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

I tried looking it up but there are so many different answers and none of them have worked for me.

:bust_in_silhouette: Reply From: a_world_of_madness

You can use set_visible(false) or visible = false to hide an object.
Here’s the documentation for the visible property of CanvasItem nodes (which is the parent class of all drawable 2D nodes).

You only need to set the visibility of the root node of the character, the child nodes will inherit the visibility status from their parent.