Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Rebinding issues

Discussion in 'Input System' started by Prototypetheta, Jan 26, 2020.

  1. Prototypetheta

    Prototypetheta

    Joined:
    May 7, 2015
    Posts:
    122
    So I'm currently having some issues with rebinding controls.

    So I've set up a rebind operation where I want to be able to rebind my action to specific joystick inputs (like say, leftStick/left if you want to move left, or have actions bound to d-pad buttons).

    My rebind step looks like this:


    Now when I activate the rebind operation, if I push up on the left stick, it sets my binding to just "leftStick". I need it to be set to "leftStick/up", else my input handler dies horrifically and we no longer have any input, which sort of puts a dampener on the whole game.

    Now I've tried reading the position of the stick and attempting to manually set the binding to up/down/left/right based on that, except the bindings are read-only so I can't even do that.

    Am I missing a flag on the rebind operation? I've read the documentation but it's not making any sense to me.

    Is the rebind operation just not capable of detecting specific axis directions anymore? Can I exclude just "leftStick" from the operation without excluding "leftStick/up" and related inputs?

    Is there a way to manually change a binding?

    EDIT: Yeah it seems this is happening cause the positions of all my axes just read (0,0) whenever I try the rebind operation. Setting a min magnitude doesn't do anything it still returns just "leftStick". Had no issues with axes reading 0 in terms of gameplay.

    EDIT2: Why can't I read axis positions while the rebinding operation is taking place??? I can't even manually check the joystick position because it just freezes.
     
    Last edited: Jan 26, 2020
  2. Prototypetheta

    Prototypetheta

    Joined:
    May 7, 2015
    Posts:
    122
    Ok, I've got a system that works When you rebind a key, it's gonna go "Oh S*** left stick hell yeah" It's then going to call another function that waits until the axis value isn't zeroed (for whatever bloody reason) in order to be able to tell which input you were actually putting in, and then it'll update the binding list. As a result you basically have to double tap axis inputs in order to set them.

    It's quite jank and I really don't understand why I can't just detect the correct input in the first place.
     
  3. Prototypetheta

    Prototypetheta

    Joined:
    May 7, 2015
    Posts:
    122
    As it turns out that didn't really work cause I'm still having to parse the action binding to load all my control settings in again.



    So does anyone know why I can't get a rebinding operation to detect joystick directions? Cause I swear this worked fine like two months ago.
     
    MCLiving88 likes this.