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

3D: When "Sync to Physics" enabled on KinematicBody, animation of translation and rotation doesn't work correctly. #58915

Open
leiget opened this issue Mar 9, 2022 · 10 comments · May be fixed by #100056

Comments

@leiget
Copy link

leiget commented Mar 9, 2022

Godot version

v3.4.2.stable.official [45eaa2d]

System information

Ubuntu 20.04 LTS

Issue description

When a 3d kinematic body has the translation and rotation animated on separate animation tracks, and "Sync to Physics" is also enabled, only the rotation animation track plays.

Steps to reproduce

  1. Make a kinematic body.
  2. Add translation and rotation animations to it.
  3. Enable "Sync to Physics" on the kinematic body.
  4. Autoplay/play the animation in-game.
  5. Only the rotation will play.

Minimal reproduction project

Here's a very simple project zip that produces this problem in Godot 3.4.2 official. Simply press F5/Run project and the bug will occur.

AnimSyncToPhysics_Bug.zip

@Calinou
Copy link
Member

Calinou commented Mar 9, 2022

@leiget Can you reproduce this after switching to GodotPhysics as the 3D physics engine in the project settings?

@leiget
Copy link
Author

leiget commented Mar 9, 2022

@Calinou Yes I can.

@fabriceci
Copy link
Contributor

This is a limitation of the current implementation of sync to physics, it registers only one transformation at a time.

@leiget
Copy link
Author

leiget commented Jul 19, 2022

This is a limitation of the current implementation of sync to physics, it registers only one transformation at a time.

Any known workarounds?

@fabriceci
Copy link
Contributor

No, sorry, I don't think this can be solved, the implementation needs to be improved.

The only thing you can do is to use only deal with this limitation or, but it's a bit tedious, not use sync to physics and update the nodes in the right order, and apply the velocity manually to the player.

@leiget
Copy link
Author

leiget commented Jul 19, 2022

No, sorry, I don't think this can be solved, the implementation needs to be improved.

The only thing you can do is to use only deal with this limitation or, but it's a bit tedious, not use sync to physics and update the nodes in the right order, and apply the velocity manually to the player.

Okay thanks

@michael-nischt
Copy link

Also encountered this issue for animated wardrobe drawers which have a kinematic body for ray-casting.

Interestingly it seems fine when sync to physics is unchecked as this video suggested for the 2D case. But I guess it's not really just an inverted toggle, right?

@Jamsers
Copy link

Jamsers commented Jul 26, 2023

Confirming that this is still an issue as of v4.1.1, I animated an AnimatableBody3D through code, simple as this:

func _process(delta):
	rotation.z += delta
	$AnimatableBody3D.position.y += delta

Interestingly it seems fine when sync to physics is unchecked as this video suggested for the 2D case.

Can also confirm toggling sync to physics off fixes animation issues in my case.

@lawnjelly lawnjelly modified the milestones: 3.5, 3.x Feb 28, 2024
@krumplespiff
Copy link

I am also still having this issue in Godot 4.2, whether it is on a parent 3d node or on the animatable body itself.

@CavemanIke
Copy link

I ran into this behavior today in 4.2.2. After some testing I found the following:

When Sync to Physics is ON:

  • Rotation and lateral movement don't work together simultaneously.
  • Rotation does not work with very small numbers. If the rotation amount is too small it will appear to rotate very slightly and then stop. Translation will work with extremely small movements without issue.
  • If the AnimatableBody is the child of a node whose translation and rotation are manipulated, the mesh will move, but the AnimatableBody will not move (evidenced by the collision shape remaining stationary). Very minute translations and rotations both work, but only visually.

When Sync to Physics is OFF everything works without issue. Rotation with very tiny movements will work just fine as well, and will also behave properly if its parent is moved around.

@huwpascoe huwpascoe linked a pull request Dec 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants