summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-19 19:35:57 +0200
committerGitHub <noreply@github.com>2021-05-19 19:35:57 +0200
commit6cc6930ee9b9a77e64f4dc60b64c76f41ef6c48d (patch)
treef0290bd0148f2d7f15a531837a6c30ad51118395
parentd5c469acfe6ba05b0a4163261791a255f6c001c4 (diff)
parenta701927d89ff492b1c49f0af071f82376249a246 (diff)
Merge pull request #48823 from timothyqiu/bone-id
Fix ragdoll simulation when parent was readded to scene
-rw-r--r--scene/3d/physics_body_3d.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp
index 30c5a75bca..93851aaedd 100644
--- a/scene/3d/physics_body_3d.cpp
+++ b/scene/3d/physics_body_3d.cpp
@@ -1958,6 +1958,8 @@ void PhysicalBone3D::_notification(int p_what) {
if (parent_skeleton) {
if (-1 != bone_id) {
parent_skeleton->unbind_physical_bone_from_bone(bone_id);
+ parent_skeleton->unbind_child_node_from_bone(bone_id, this);
+ bone_id = -1;
}
}
parent_skeleton = nullptr;