From cf61f5e93809c9f80efdea08f733f2615867cb1d Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Mon, 30 Oct 2023 14:53:09 +0800 Subject: [PATCH] Hide CSGShape's debug_collision_shape when it is invisible (cherry picked from commit 173e2c7f29c6d4304bf02f895082a34cf30c0908) --- modules/csg/csg_shape.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 66ce28893ca..814f2184b02 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -573,6 +573,11 @@ void CSGShape3D::_notification(int p_what) { // Update this node's parent only if its own visibility has changed, not the visibility of parent nodes parent_shape->_make_dirty(); } + if (is_visible()) { + _update_debug_collision_shape(); + } else { + _clear_debug_collision_shape(); + } last_visible = is_visible(); } break;