summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2021-05-19 10:22:15 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2021-05-19 10:22:15 +0800
commita701927d89ff492b1c49f0af071f82376249a246 (patch)
tree925e32344635423dcc64720e944e2232b2bf2d72
parentc340ed63943aa7c02064e536ff302de300a02ec2 (diff)
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;