浏览代码

Merge pull request #92302 from jsjtxietian/debug-shape-null

Fix null `debug_shape` being updated when `CollisionObject3D`'s transform changed
Rémi Verschelde 1 年之前
父节点
当前提交
8adf9e4d97
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      scene/3d/physics/collision_object_3d.cpp

+ 3 - 0
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);
 			}
 		}