diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-30 15:15:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-30 15:15:00 +0200 |
commit | 5d6a98f04ef09176cc10e27d788965d76d7ddf09 (patch) | |
tree | 7bfcf382cd81dce4a1f92ab2ac291a7bbd020797 /scene/2d | |
parent | a662ca66aacd6e5e817c369570ad9179edc8e673 (diff) | |
parent | 6e6f292f154945654fcd752d5f9ee643d878cc59 (diff) |
Merge pull request #53239 from nekomatata/fix-animatable-body-initial-state
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/physics_body_2d.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index c07a999588..d34a1e1c62 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -288,6 +288,12 @@ void AnimatableBody2D::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { last_valid_transform = get_global_transform(); + _update_kinematic_motion(); + } break; + + case NOTIFICATION_EXIT_TREE: { + set_only_update_transform_changes(false); + set_notify_local_transform(false); } break; case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: { @@ -313,7 +319,6 @@ void AnimatableBody2D::_bind_methods() { AnimatableBody2D::AnimatableBody2D() : StaticBody2D(PhysicsServer2D::BODY_MODE_KINEMATIC) { - _update_kinematic_motion(); } void RigidDynamicBody2D::_body_enter_tree(ObjectID p_id) { |