summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2020-12-25 14:59:53 +0100
committerGitHub <noreply@github.com>2020-12-25 14:59:53 +0100
commit7d972b8c67412571e5ceb1d975aa5161e4e9e27b (patch)
tree32a4e79939b86623961385f57cceb7430b891d95
parentecffa43335bc26990992784405076732d531bd15 (diff)
parent11bee25de4d07497d3bb8f3165937c879f0c9ef8 (diff)
Merge pull request #44640 from nekomatata/joint2d_update_body_transforms
Update body transforms on joint2D setup
-rw-r--r--scene/2d/joints_2d.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp
index f5d13fd641..3e37f2d2bb 100644
--- a/scene/2d/joints_2d.cpp
+++ b/scene/2d/joints_2d.cpp
@@ -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.");