|
@@ -2161,6 +2161,9 @@ void PhysicalBone::_notification(int p_what) {
|
|
update_bone_id();
|
|
update_bone_id();
|
|
reset_to_rest_position();
|
|
reset_to_rest_position();
|
|
_reset_physics_simulation_state();
|
|
_reset_physics_simulation_state();
|
|
|
|
+ if (!joint.is_valid() && joint_data) {
|
|
|
|
+ _reload_joint();
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case NOTIFICATION_EXIT_TREE:
|
|
case NOTIFICATION_EXIT_TREE:
|
|
if (parent_skeleton) {
|
|
if (parent_skeleton) {
|
|
@@ -2169,7 +2172,10 @@ void PhysicalBone::_notification(int p_what) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
parent_skeleton = NULL;
|
|
parent_skeleton = NULL;
|
|
- update_bone_id();
|
|
|
|
|
|
+ if (joint.is_valid()) {
|
|
|
|
+ PhysicsServer::get_singleton()->free(joint);
|
|
|
|
+ joint = RID();
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case NOTIFICATION_TRANSFORM_CHANGED:
|
|
case NOTIFICATION_TRANSFORM_CHANGED:
|
|
if (Engine::get_singleton()->is_editor_hint()) {
|
|
if (Engine::get_singleton()->is_editor_hint()) {
|