summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorCameron Reikes <cameronreikes@gmail.com>2019-05-29 16:09:52 -0700
committerCameron Reikes <cameronreikes@gmail.com>2019-05-29 16:09:52 -0700
commit9f29c28918e41a97266cbdd267fbba6e1ea5352f (patch)
tree7077d0bc7f456eb9acbd3e76cff487ec483b86b8 /scene/3d
parent8c923fc61740afd560e6c814f7ef19b0cdc30112 (diff)
Check if parent is null before updating trasnform
- parent being null means it's not a CollisionObject
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/collision_shape.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp
index 3190e1e0b2..219ea56681 100644
--- a/scene/3d/collision_shape.cpp
+++ b/scene/3d/collision_shape.cpp
@@ -228,7 +228,9 @@ void CollisionShape::_update_debug_shape() {
void CollisionShape::_shape_changed() {
// If this is a heightfield shape our center may have changed
- _update_in_shape_owner(true);
+ if (parent) {
+ _update_in_shape_owner(true);
+ }
if (is_inside_tree() && get_tree()->is_debugging_collisions_hint() && !debug_shape_dirty) {
debug_shape_dirty = true;