summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-09-05 13:59:51 +0200
committerGitHub <noreply@github.com>2022-09-05 13:59:51 +0200
commit904d8bdb3c6ef37bbabcd81cb694151c76047c48 (patch)
treec65469adf6d255b5e71a142e09ed95dc446a4c4a /scene/3d
parent3e6c3429958b490e86a466a52a43a6e1ee894467 (diff)
parent44042a957f090f702a29ddf1224c8299785fe87a (diff)
Merge pull request #65292 from AlmightyLaxz/prevent-shapecast3d-debug-without-debugcollisions
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/shape_cast_3d.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/3d/shape_cast_3d.cpp b/scene/3d/shape_cast_3d.cpp
index d324e09df5..a2fecf9c31 100644
--- a/scene/3d/shape_cast_3d.cpp
+++ b/scene/3d/shape_cast_3d.cpp
@@ -205,7 +205,7 @@ bool ShapeCast3D::is_enabled() const {
void ShapeCast3D::set_target_position(const Vector3 &p_point) {
target_position = p_point;
- if (is_inside_tree()) {
+ if (is_inside_tree() && get_tree()->is_debugging_collisions_hint()) {
_update_debug_shape();
}
update_gizmos();
@@ -306,7 +306,7 @@ real_t ShapeCast3D::get_closest_collision_unsafe_fraction() const {
}
void ShapeCast3D::resource_changed(Ref<Resource> p_res) {
- if (is_inside_tree()) {
+ if (is_inside_tree() && get_tree()->is_debugging_collisions_hint()) {
_update_debug_shape();
}
update_gizmos();
@@ -327,7 +327,7 @@ void ShapeCast3D::set_shape(const Ref<Shape3D> &p_shape) {
shape_rid = shape->get_rid();
}
- if (is_inside_tree()) {
+ if (is_inside_tree() && get_tree()->is_debugging_collisions_hint()) {
_update_debug_shape();
}