diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index cc66d42fbe8..8ca7196a384 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -168,14 +168,17 @@ NodePath Joint2D::get_node_b() const { void Joint2D::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_READY: { + case NOTIFICATION_POST_ENTER_TREE: { + if (joint.is_valid()) { + _disconnect_signals(); + } _update_joint(); } break; case NOTIFICATION_EXIT_TREE: { if (joint.is_valid()) { _disconnect_signals(); - _update_joint(true); } + _update_joint(true); } break; } } diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp index 35eb49b19a0..cc0c64426a7 100644 --- a/scene/3d/physics_joint.cpp +++ b/scene/3d/physics_joint.cpp @@ -178,14 +178,17 @@ int Joint::get_solver_priority() const { void Joint::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_READY: { + case NOTIFICATION_POST_ENTER_TREE: { + if (joint.is_valid()) { + _disconnect_signals(); + } _update_joint(); } break; case NOTIFICATION_EXIT_TREE: { if (joint.is_valid()) { _disconnect_signals(); - _update_joint(true); } + _update_joint(true); } break; } }