From 2206c5e9c0d531b3186c6acf4f16327682721900 Mon Sep 17 00:00:00 2001 From: "yakun.zhang" Date: Sun, 5 May 2019 13:30:58 +0800 Subject: [PATCH] fix CollisonShape changing shape cause crash when not in a tree --- scene/3d/collision_shape.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp index 6bb2b547c76..f32b1398fd6 100644 --- a/scene/3d/collision_shape.cpp +++ b/scene/3d/collision_shape.cpp @@ -228,7 +228,7 @@ void CollisionShape::_update_debug_shape() { } void CollisionShape::_shape_changed() { - if (get_tree()->is_debugging_collisions_hint() && !debug_shape_dirty) { + if (is_inside_tree() && get_tree()->is_debugging_collisions_hint() && !debug_shape_dirty) { debug_shape_dirty = true; call_deferred("_update_debug_shape"); }