Horizontal/Vertical Axis. KeyBoard / Controller Differences

Hey lads, I was curious why my character behaves differently depending on whether I use keyboard or controller.

So I’m using GetAxisRaw which gets either -1, 0, 1, right, no in between.

If I use the d-pad on the controller, the character is snappy and instantly switches angles, like pure 8 directional movement.

If I use the keyboard though, W, A, S, D it’s almost as if it lerps the movement, it rotates over time, not instantly. But both use the same code, why is that?

Code for reference;

 void PlayerDirection()
    {
        if (Input.GetAxisRaw("Horizontal") != 0 || Input.GetAxisRaw("Vertical") != 0)
        {
            angle = Mathf.Atan2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")) * Mathf.Rad2Deg;
        }
        transform.eulerAngles = new Vector3(0, angle, 0);
    }

    void PlayerLocomotion()
    {
        Vector3 movement = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical"));
        gameObject.GetComponent<Rigidbody>().velocity = movement.normalized * speed * Time.deltaTime;
    }

Buttons and Joysticks have different inputs set up in the Input Manager. Make sure all of the Horizontal and Vertical axes are setup the way you want in the manager, paying special attention to Dead Zone, Sensitivity, and Snap.

1 Like

Edit: Actually, I changed them all the the same setting, including checking “snap” and no, they still act completely different.

Ah man, you know, I didn’t even think of checking that, I haven’t needed to change them. But yeah, they have different sensitivity and Dead settings. Thank you, I will play with this