• Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.3, (17)
      23w04a, 1.19.4 Pre-release 2, 1.19.4 Pre-release 3, 1.19.4 Release Candidate 2, 1.19.4, 23w12a, 23w16a, 1.20 Release Candidate 1, 1.20, 1.20.4, 24w09a, 24w10a, 24w11a, 1.20.6, 1.21.1, 1.21.3, 1.21.4 Release Candidate 3
    • None
    • Confirmed
    • Camera
    • Low
    • Platform

      Steps to reproduce:

      • move your mouse without riding anything, this is expected behavior
      • ride something
      • move your mouse. now horizontal movement seems to lag behind vertical

      In the attached video, a cursor is drawn directly with the X and Y components of the camera rotation matrix to demonstrate the issue. The behavior can be observed without it, albeit less noticeable. It is possible to see the issue without the custom cursor if you focus on a corner of the stone platform. It may be easier to notice when moving the mouse fast in a large circular motion, or flicking the mouse diagonally

          [MC-259512] Horizontal camera rotation lags when riding

          ioblackshaw added a comment - - edited

          I looked at the code a bit, and the `getViewYRot` method inside `net.minecraft.client.player.LocalPlayer` (below) seems to be a cause of this issue (this is 1.21.2-rc1 with mojmap)

          public float getViewYRot(float f) {
              if (this.isPassenger()) {
                  return super.getViewYRot(f);
              }
              return this.getYRot();
          }

          When the player is riding an entity, this method returns the result of `AbstractClientPlayer#getViewYRot`, otherwise it returns `LocalPlayer#getYRot`.

          One fix could be to make this method always return the result of `LocalPlayer#getYRot`, although this would make mounts like horses no longer visually locked to the player's camera rotation, instead lagging slightly behind when rotating the camera. I tested this by writing a quick fabric mod, and it seemed to work well under a lot of circumstances, including using /rotate while riding entities

          Alternatively, it could only return the result of `AbstractClientPlayer#getViewYRot` when riding horses (and similar) as opposed to any entity like it currently does. This would keep the camera locked to the horse's rotation and would remove the lag when riding other entities that the player doesn't have direct control over.

          There is probably other ways to fix this, just thought I'd leave some ideas

          ioblackshaw added a comment - - edited I looked at the code a bit, and the `getViewYRot` method inside `net.minecraft.client.player.LocalPlayer` (below) seems to be a cause of this issue (this is 1.21.2-rc1 with mojmap) public float getViewYRot( float f) { if ( this .isPassenger()) { return super .getViewYRot(f); } return this .getYRot(); } When the player is riding an entity, this method returns the result of `AbstractClientPlayer#getViewYRot`, otherwise it returns `LocalPlayer#getYRot`. One fix could be to make this method always return the result of `LocalPlayer#getYRot`, although this would make mounts like horses no longer visually locked to the player's camera rotation, instead lagging slightly behind when rotating the camera. I tested this by writing a quick fabric mod, and it seemed to work well under a lot of circumstances, including using /rotate while riding entities Alternatively, it could only return the result of `AbstractClientPlayer#getViewYRot` when riding horses (and similar) as opposed to any entity like it currently does. This would keep the camera locked to the horse's rotation and would remove the lag when riding other entities that the player doesn't have direct control over. There is probably other ways to fix this, just thought I'd leave some ideas

          Triton365 added a comment -

          /rotate command also seems to have this issue. If you run /rotate @s ~30 ~ while riding something, the horizontal rotation is interpolated.

          I think this issue should be considered more important than before, especially since the main reason /rotate was added to the game was to rotate while riding.

          Triton365 added a comment - /rotate command also seems to have this issue. If you run /rotate @s ~30 ~ while riding something, the horizontal rotation is interpolated. I think this issue should be considered more important than before, especially since the main reason /rotate was added to the game was to rotate while riding.

          ioblackshaw added a comment - - edited

          This is greatly exaggerated at low tick speeds, making the camera almost impossible to move horizontally (see video i attached).
          You can see this by riding an entity and running /tick rate 1 and moving the camera, notice how vertical camera movement is unaffected while horizontal movement doesnt update for multiple ticks

          This is still present in 1.21.2 - prerelease 1

          ioblackshaw added a comment - - edited This is greatly exaggerated at low tick speeds, making the camera almost impossible to move horizontally (see video i attached). You can see this by riding an entity and running /tick rate 1 and moving the camera, notice how vertical camera movement is unaffected while horizontal movement doesnt update for multiple ticks This is still present in 1.21.2 - prerelease 1

          BugTracker added a comment -

          Affects 24w14a.

          BugTracker added a comment - Affects 24w14a.

          [Bot] Arisa added a comment -

          Please do not mark Unreleased Versions as affected. You don't have access to them yet.

          – I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit

          [Bot] Arisa added a comment - Please do not mark Unreleased Versions as affected. You don't have access to them yet. – I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit

            Unassigned Unassigned
            Godlander Godlander
            Votes:
            23 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              CHK: