Unity Gamepad Input issue

My issue :

  • Keyboard movement is nice and smooth
  • Gamepad movement is janky and snaps from one state to another

Is this an issue with my gamepad or something I can fix in Unity? I tried the same gamepad on the same system with Unreal 4 and it works fine there. Unfortunately, I don’t have access to the same project on both game engines.

Here is a screen recording with the issue

Platform - Mac OS Big Sur + Unity 2020.3
Gamepad - I tried a JoyCon / Switch Pro controller / 8BitDo SN30Pro - All had the same issue.
Input Sistem - Rewired (Guavaman Enterprises | Rewired )

Hi,

Have you already tried to plug the gamepad out and in again?

For anyone looking for a solution here it is :

You can apply the same smoothing function to your Gamepad GetAxis the same way Unity apply’s it to Keyboard GetAxis

You can read about this here https://answers.unity.com/questions/958683/using-unitys-same-smoothing-from-getaxis-on-arrow.html

//These values are the same values you will find inside Unity > Input Settings 
float sensitivity = 3f;
float dead = 0.001f;

//Create another float for the "Raw" GetAxis values
 float rawXThrow;
 float xThrow;
 float rawYThrow;
 float yThrow;

void ProcessTranslation()
    {
//Get the normal Axis values
        rawXThrow = player.GetAxis("Move Horizontal");
        rawYThrow = player.GetAxis("Move Vertical");
//Apply the Smoothing function to them
        xThrow = Mathf.MoveTowards(xThrow, rawXThrow, sensitivity * Time.deltaTime);
        yThrow = Mathf.MoveTowards(yThrow, rawYThrow, sensitivity * Time.deltaTime);
}

Fantastic. Thanks for sharing your solution! :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms