summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-10-30 13:57:42 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-10-30 13:57:42 +0100
commit23bcb702ec4f0677c35f60681b782cbb05b8b4a9 (patch)
tree900e579ab076ac0fc3f2997afa35291d0b4dc001
parent030dcedf93b3e3ae599504d7ee51091259be1616 (diff)
parent173e2c7f29c6d4304bf02f895082a34cf30c0908 (diff)
downloadredot-engine-23bcb702ec4f0677c35f60681b782cbb05b8b4a9.tar.gz
Merge pull request #84174 from jsjtxietian/hide_debug_collision_shape_when_csgshape_invisible
Hide CSGShape's `debug_collision_shape` when it is invisible
-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;