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
Linked issues
is duplicated by 3
Attachments
Comments 5
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
/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.
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
⚠️ 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