浏览代码

Fix ragdoll simulation when parent was readded to scene

(cherry picked from commit a701927d89ff492b1c49f0af071f82376249a246)
Haoyu Qiu 4 年之前
父节点
当前提交
f75ace5ac5
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      scene/3d/physics_body.cpp

+ 2 - 0
scene/3d/physics_body.cpp

@@ -2077,6 +2077,8 @@ void PhysicalBone::_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;