summaryrefslogtreecommitdiffstats
path: root/modules/csg
diff options
context:
space:
mode:
authorjsjtxietian <jsjtxietian@outlook.com>2023-10-30 14:53:09 +0800
committerjsjtxietian <jsjtxietian@outlook.com>2023-10-30 14:53:09 +0800
commit173e2c7f29c6d4304bf02f895082a34cf30c0908 (patch)
treebbb94a5ff7a0413a8aaee254968f65028cce8621 /modules/csg
parent9144457484f9d2f53990a0aac37caff1c9012e6d (diff)
downloadredot-engine-173e2c7f29c6d4304bf02f895082a34cf30c0908.tar.gz
Hide CSGShape's debug_collision_shape when it is invisible
Diffstat (limited to 'modules/csg')
-rw-r--r--modules/csg/csg_shape.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 0656f8224c..0fc61dfe92 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;