Browse Source

Merge pull request #48823 from timothyqiu/bone-id

Fix ragdoll simulation when parent was readded to scene
Rémi Verschelde 4 years ago
parent
commit
6cc6930ee9
1 changed files with 2 additions and 0 deletions
  1. 2 0
      scene/3d/physics_body_3d.cpp

+ 2 - 0
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;