Skip to content

Commit

Permalink
Merge pull request #44640 from nekomatata/joint2d_update_body_transforms
Browse files Browse the repository at this point in the history
Update body transforms on joint2D setup
  • Loading branch information
akien-mga authored Dec 25, 2020
2 parents ecffa43 + 11bee25 commit 7d972b8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scene/2d/joints_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ void Joint2D::_update_joint(bool p_only_free) {
warning = String();
update_configuration_warning();

if (body_a) {
body_a->force_update_transform();
}

if (body_b) {
body_b->force_update_transform();
}

joint = _configure_joint(body_a, body_b);

ERR_FAIL_COND_MSG(!joint.is_valid(), "Failed to configure the joint.");
Expand Down

0 comments on commit 7d972b8

Please sign in to comment.