Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Stick on xbox controller gets stuck on latest value when releasing the stick

Discussion in 'Input System' started by Jointy87, Sep 20, 2023.

  1. Jointy87

    Jointy87

    Joined:
    Dec 19, 2019
    Posts:
    21
    Heya,

    I'm having the following issue when using either an Xbox one or an Xbox 360 controller. It does NOT happen when using a PlayStation controller.

    When I'm moving around using the left stick I might get a value of (1.00, 0.00) for instance.
    When I release the stick, the input often stays at it's previous value, in this case (1.00, 0.00).

    The expected behavior here would be that the input system registers the fact that the stick is back in its neutral position and thus should register as (0.00, 0.00).

    Whenever I move the left stick again afterwards, everything goes back to normal. It also only seems to happen if the stick 'snaps back' to it's neutral position instead of it slowly getting to there.

    These are the settings I'm using in the input system:
    Composite Type = 2D Vector
    Mode = Digital
    Stick dead zone min = .3f, max = default.
    Binding path = [Xbox Controller] inputs

    I'm on Unity 2021.3.26f1 using new Input System 1.5.1

    I'm registering input using a simple
    Code (CSharp):
    1. controls.Gameplay.StickMovement.performed += ctx => stickValue = ctx.ReadValue<Vector2>();
    I've tried fiddling around with the dead zones, adding a 'scale vector 2' value. I've also tried a possible solution mentioned here thinking maybe it had to do with snapback: https://forum.unity.com/threads/solved-controller-input-values-snapback.880900/ but this didn't do anything either.

    I hope someone can help me out with this. I feel like I'm overlooking something. And I can't really find any similar posts about it online so it must be totally fixable, I'm just not seeing it.

    Thanks!