Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnimatableBody2D animates only one property when sync_to_physics is enabled (using AnimationPlayer) #98970

Open
stephanbogner opened this issue Nov 8, 2024 · 4 comments · May be fixed by #100056 or #99012

Comments

@stephanbogner
Copy link

Tested versions

Godot v4.3.stable

System information

macOS 14.6.1 - Vulkan (Forward+) - integrated Apple M2 Pro - Apple M2 Pro (10 Threads)

Issue description

  1. I am animating a AnimatableBody2D using an AnimationPlayer
  2. The AnimatableBody2D is not moving unless I turn off sync_to_physics
  3. I tried with bezier curve animation and without, no change
  4. At some point it animated at least partially, now (with no conscious change) it doesn't animate at all
  5. Since it does animate with sync_to_physics turned off I assume it's not an error on my side

If anybody has any ideas, please. I have no clue anymore ...

Potentially related issues:

Steps to reproduce

I am not able to reproduce it from scratch, but I extracted the problem from my larger project:

  1. Open and run the project (with visible collision shapes)
  2. Shape should move, but doesn't 😭
  3. Turn off sync_to_physics on to animatable_body_2d and run scene
  4. It now moves 😤

Minimal reproduction project (MRP)

bug-animating-animatable-body-zip.zip

@AThousandShips AThousandShips changed the title AnimatableBody2D does not animate using AnimationPlayer2D when sync_to_physics is turned on AnimatableBody2D does not animate using AnimationPlayer when sync_to_physics is turned on Nov 8, 2024
@stephanbogner
Copy link
Author

stephanbogner commented Nov 8, 2024

I think I figured it out 🔥: Multiple "channels" won't animate in parallel

  • A) Works ("normal" animation)
  • B) Glitches (position is split up into x and y when using bezier curves)
  • C) Works (bezier curve animation but only one axis)

→ Only one property will animate properly. If you add a rotation channel, then either position or rotation won't animate anymore (when using sync_to_physics).

bug-animating-animatable-body-alt.zip

test2

@stephanbogner
Copy link
Author

So it's probably the same underlying issue as @ZeAntwan encountered in #76685

@stephanbogner stephanbogner changed the title AnimatableBody2D does not animate using AnimationPlayer when sync_to_physics is turned on AnimatableBody2D animates only one property when sync_to_physics is enabled (using AnimationPlayer) Nov 8, 2024
@stephanbogner
Copy link
Author

The code seems pretty short, so maybe it's not hard to fix ... but I don't understand anything 😭

@reach-satori
Copy link
Contributor

Reproduced, in animation3d too. It looks like the transform is set each frame as many times as there are tracks separately, so only the last one applies.
Also happens, for example, if you add a 3d rotation track after adding the bezier: then only the rotation happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants