mojira.dev
MCPE-122663

Player model isn't centered when swimming

The swimming animation was changed in 1.13 due to the player model being made data driven. However, it wasn't centered correctly.

To fix this, simply change the root position in the swimming animation from this...

"position" : [ 0.0, "(math.sin(query.target_x_rotation) * 24.0 + 3.0) * variable.swim_amount", "(math.cos(query.target_x_rotation) * 24.0 + 9.0) * variable.swim_amount" ]

to this.

"position" : [ 0.0, "17.0 + math.sin(math.lerp(-90.0, query.target_x_rotation, variable.swim_amount)) * 17.0 - 12.0 * variable.swim_amount", "math.cos(math.lerp(-90.0, query.target_x_rotation, variable.swim_amount)) * 17.0" ]

I have attached some pictures of how the animation plays on Java Edition, how it is on Bedrock and how it looks with the fix applied.

Notes: There's also some minor offset seen when the player is facing upwards or downwards, but taking these pictures takes time. The suggested fix addresses that too.

Linked issues

Attachments

Comments 4

Β Can confirm, affects 1.16.210

Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response

Is this still an issue in the latest version? If so, please add a comment or update the affected version field.

To make your bug report as effective as possible, please try and include the following steps to reproduce the problem:

Steps to Reproduce:
1.
2.
3.

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

If your ticket does not look like the example given here, then it's likely to be closed as incomplete.

This ticket will automatically reopen when you reply.

Quick Links:
πŸ““ Issue Guidelines – πŸ’¬ Mojang Support – πŸ“§ Suggestions – πŸ“– Minecraft Wiki

This can be easily observed when swimming in third person view.

Partially fixed in 1.20.10.20 Preview - The model is now properly centered while variable.swim_amount is 1, but the transition is still not centered, which can be easily observed when looking downwards.

The suggested fix uses the variable inside of a lerp instead of a simple multiplication, which applies the centering math to the transition as well.

[Mod] LateLag

(Unassigned)

497281

Confirmed

Multiple

1.20.10.20 Preview, 1.19.70.24/25 Preview, 1.18.30.23 Preview, 1.18.30.22 Beta, 1.16.230.50 Beta, 1.16.210, 1.18.12 Hotfix, 1.19.63

1.20.10.20 Preview

Retrieved