Readvalue not clamped

Hejhej I’m new to this
Is there a possibility to get the leftstick value of a gamepad in a not rounded value? It seems to be much more precise when you are using the Input component. (The Vector is reading is something like 0.957 instead of 1.0) I dont think it should make any difference in the gameplay, but I’m still wondering if there is a method to do that.
I appreciate all the help I can get :slight_smile:

Edit: thanks for the help, but I meant rounded instead of clamped. My fault.

Hmmm… puzzling. I wouldn’t be that surprised if the Input System and the old Input class both read 0.957, as that might just mean your controller’s stick never reaches full deflection internally. But there’s no reason I can think of why they should report different values. When I run this code:

using UnityEngine;
using UnityEngine.InputSystem;

public class StickReporter : MonoBehaviour
{
    public InputAction leanAction;

    void Start()
    {
        leanAction.Enable();
        leanAction.performed += c => Debug.Log(c.ReadValue<float>());
    }
}

I see all values from -1 to 1 for the left stick’s x-axis on my gamepad. I’m using a simple binding:

7016323--830305--upload_2021-4-7_18-23-38.png

There are no interactions nor any processors assigned:

7016323--830308--upload_2021-4-7_18-24-30.png

A processor could introduce the behavior you are seeing, though I can’t think of a reason why anyone would create such a processor. It would look like this:

7016323--830311--upload_2021-4-7_18-25-51.png

You could kind of solve your problem if you added an Axis Deadzone processor:

7016323--830314--upload_2021-4-7_18-28-10.png

I wouldn’t expect you to think that’s a good permanent solution, but maybe you should try it to see if it does what we expect. That might teach us something we can use to pursue this further.

1 Like