Why Input.GetAxis("Horizontal") returning 0 when paused?

Hello there,
Why Input.GetAxis(“Horizontal”) and Input.GetAxis(“Vertical”)
returning 0 when Time.timescale is 0?
Though Input.GetAxis(“Mouse X”) and Input.GetAxis(“Mouse Y”) working fine even when game is paused. I am running these codes in the update. I see this is a very old problem but I couldn’t find the correct answer.

That sounds strange and perhaps not intended.
GetAxis does some calculations on the raw input, perhaps something doesn’t play well with 0 timeScale there.
Try using GetAxisRaw.

(There’s also the new input system to try)

Can you post the code in question? The thread you necroed noted they were multiplying by Time.deltaTime which was causing the 0 value.

Here is the code:

void Update()
{
    panControl();
}

void panControl()
{
   if(Input.GetMouseButton(2))
        {
            xDrag = Input.GetAxis("Mouse X");
            yDrag = Input.GetAxis("Mouse Y");
        }
        else
        {
            xDrag = -Input.GetAxis("Horizontal") / ) ;
            yDrag = -Input.GetAxis("Vertical");
        }
}

I already tried with Debug.Log(Input.GetAxis(“Horizontal”)) and Debug.Log(Input.GetAxis(
“Vertical”
)) both giving 0.

And I just tested, Debug.Log(Input.GetAxisRaw(“Horizontal”)); working as expected.

If you ask a question such as,

“Why Input.GetAxis(“Horizontal”) returning 0 when paused?”

Then please don’t post code that negates it, divides it by four, multiplies it by dragSpeed, and THEN finally uses it.

You already know that the first most obvious thing any engineer here is going to ask is “Well, what is dragSpeed?!” so why not eliminate it from the start?