Why does the player stick to vertical and horizontal axis when looking?

I am making a 3d twin-stick shooter.

This is the code I use for looking with a right stick in FixedUpdate:

//process aim player input
float aimHorizontal = Input.GetAxisRaw("Horizontal2");
float aimVertical = Input.GetAxisRaw("Vertical2");

var lookDirection = new Vector3(aimHorizontal, 0, aimVertical);

if (lookDirection != Vector3.zero)
{
    transform.LookAt(transform.position - lookDirection, Vector3.up);
}

Everything works, but the player keeps “snapping” to vertical and horizontal looking directions (you can see this in video - https://www.youtube.com/watch?v=zLOm89RWZX0 ).

How can I avoid this? The xbox gamepad I use itself seems fine, games like “Ruiner” does not seem to suffer from this issue. I tried using both GetAxisRaw and GetAxis and didn’t see any changes.

This seems to be an effect of the “dead zone” - when an axis is near zero, it gets reported as being zero (so that a slightly miscalibrated stick doesn’t result in constant bad input). Try setting that to zero. (If desired, you can re-implement your own “dead zone” algorithm that only kicks in if BOTH axes are near zero.)

@StarManta OMG, that’s it! Thank you very much! I never realized that the dead zone implementation works for both axis independently, that makes total sense now