From 2546dada7538355207a0f9823a9ac1e843723c45 Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Fri, 24 May 2024 12:56:20 +0800 Subject: [PATCH] Fix null `debug_shape` being updated when `CollisionObject3D`'s transform changed --- scene/3d/physics/collision_object_3d.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/3d/physics/collision_object_3d.cpp b/scene/3d/physics/collision_object_3d.cpp index dddaf7eb4af..f11aa7012ae 100644 --- a/scene/3d/physics/collision_object_3d.cpp +++ b/scene/3d/physics/collision_object_3d.cpp @@ -439,6 +439,9 @@ void CollisionObject3D::_on_transform_changed() { } const ShapeData::ShapeBase *shape_bases = shapedata.shapes.ptr(); for (int i = 0; i < shapedata.shapes.size(); i++) { + if (shape_bases[i].debug_shape.is_null()) { + continue; + } RS::get_singleton()->instance_set_transform(shape_bases[i].debug_shape, debug_shape_old_transform * shapedata.xform); } }