CigarLounge / sbox-TTT

TTT is a mafia-esque multiplayer game created using s&box
https://cigarlounge.github.io/
Other
21 stars 11 forks source link

Fix: Rifle zoom sensitivity feels bad #330

Closed the-remeko closed 1 year ago

the-remeko commented 1 year ago

When zoomed in with the scout, your view would only turn one step for every two steps registered by the mouse. This made sniping feel like crap, and it also made it harder to aim at distant targets.

If you want to see the problem for yourself, paste this at the end of Player.FrameSimulate (a low mouse DPI makes it much easier to move one step at a time with the mouse): var rotStr = $"{ViewAngles.pitch}, {ViewAngles.yaw}, {ViewAngles.roll}"; DebugOverlay.ScreenText( rotStr, 5 ); var camRotStr = $"{Camera.Rotation.Angles().pitch}, {Camera.Rotation.Angles().yaw}, {Camera.Rotation.Angles().roll}"; DebugOverlay.ScreenText( camRotStr, 6 );

dch-GH commented 1 year ago

Tested and can confirm it's much smoother. LGTM 👍

Used this to see it in real time without recompiling.

        if ( Input.Down( InputButton.Use ) )
            Camera.Rotation = !target.IsLocalPawn ? Rotation.Slerp( Camera.Rotation, target.EyeRotation, Time.Delta * 20f ) : target.ViewAngles.ToRotation();
        else
            Camera.Rotation = !target.IsLocalPawn ? Rotation.Slerp( Camera.Rotation, target.EyeRotation, Time.Delta * 20f ) : target.EyeRotation;
matekdev commented 1 year ago

Thanks @the-remeko ! 😱

Honestly once we convert the weapon into using components/events we should consider fixing up the scope fully. Disabling the crosshair, decreasing move speed? There is probably some of things we are missing.