From 127f3c05666b671a44147fbced90a44d9e5d43bd Mon Sep 17 00:00:00 2001 From: Eryk Dwornicki Date: Sat, 27 Feb 2021 16:38:58 +0100 Subject: [PATCH] Fixed bug that caused collision not to be properly reenabled when joint between two bodies is destroyed (cherry picked from commit 519e314bea2b1552f317d96efb7c9d0ad268e8bc) --- scene/3d/physics_joint.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp index 0dfd9e11a4..f2d26f81a8 100644 --- a/scene/3d/physics_joint.cpp +++ b/scene/3d/physics_joint.cpp @@ -62,8 +62,10 @@ void Joint::_body_exit_tree(const ObjectID &p_body_id) { void Joint::_update_joint(bool p_only_free) { if (joint.is_valid()) { - if (ba.is_valid() && bb.is_valid()) + if (ba.is_valid() && bb.is_valid()) { PhysicsServer::get_singleton()->body_remove_collision_exception(ba, bb); + PhysicsServer::get_singleton()->body_remove_collision_exception(bb, ba); + } PhysicsServer::get_singleton()->free(joint); joint = RID();