Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-122663

Player model isn't centered when swimming

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • 1.20.10.20 Preview
    • 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
    • None
    • Confirmed
    • Multiple
    • 497281

      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.

        1. Java.png
          44 kB
          [Mod] LateLag
        2. Bedrock (vanilla).png
          204 kB
          [Mod] LateLag
        3. Bedrock (fixed).png
          202 kB
          [Mod] LateLag

            LateLag [Mod] LateLag
            Votes:
            13 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              CHK: