diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 79f37ed89e0..163691d65d6 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -913,14 +913,15 @@ void Spatial::show() { data.visible = true; - if (!is_inside_tree()) { - return; - } - bool parent_visible = get_parent_spatial() ? get_parent_spatial()->data.visible_in_tree : true; if (parent_visible) { _propagate_visible_in_tree(true); } + + if (!is_inside_tree()) { + return; + } + _propagate_visibility_changed(); } @@ -931,14 +932,15 @@ void Spatial::hide() { data.visible = false; - if (!is_inside_tree()) { - return; - } - bool parent_visible = get_parent_spatial() ? get_parent_spatial()->data.visible_in_tree : true; if (parent_visible) { _propagate_visible_in_tree(false); } + + if (!is_inside_tree()) { + return; + } + _propagate_visibility_changed(); }