Right thumbstick (Rz) drift - camera moves on its own

Hello, I’ve encountered quite common problem where camera wildly rotates on its own when joystick/gamepad is plugged while trying to make camera controllable with it. The problem seem to touch only right stick’s left-right axis (Rz) and not any other.

The analog stick in question works fine in non-unity applications, such as emulators, so it is definitely not a hardware issue. Any suggestions how to fix it? The goal is for the player to be able to just use gamepad without any previous configuration, left stick for movement, right for the camera.

Set dead zone to 1 or to size that will work for you on your project, keep making it go up until it stops moving.

I’m doing the same thing and getting this exact same problem as well… All other axes are working just fine.

Hi,
I have modified the MouseLook.cs script from the FPSController to cut the parasite positions.
When the joystick is static, I force the rotation to Zero.
Add that to the script after the line 33-34 :

            float yRot = CrossPlatformInputManager.GetAxis("Mouse X") * XSensitivity;
            float xRot = CrossPlatformInputManager.GetAxis("Mouse Y") * YSensitivity;
            //Smooth static position of the View Joystick
            if (Mathf.Abs(yRot) < 0.1f)
            {
                if (Mathf.Abs(xRot) < 0.1f)
                {
                    yRot = 0.0f;
                    xRot = 0.0f;
                }
            }

Best Regards,
Clément