Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Input System NOT Recongnizing Bindings for Player Input

Discussion in 'Input System' started by zenasprime, Jul 5, 2023.

  1. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    Input from the keyboard is working fine. Gamepad works fine for UI. Will not work for player input at all.

    Player Input clearly indicates that it will call the OnMove and OnFire functions. And it clearly does when the keyboard bindings are used.

    I've run out of avenues to go down where this could be configure improperly but who knows. Does anyone have a clue why this isn't working as expected?



     
  2. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    Anyone out there?
     
  3. KillDashNine

    KillDashNine

    Joined:
    Apr 19, 2020
    Posts:
    449
    Do you have multiple PlayerInputs?

    "Each PlayerInput instance represents a separate player or user. You can use multiple PlayerInput instances at the same time (although not on the same GameObject) to represent local multiplayer setups."

    https://docs.unity.cn/Packages/com.unity.inputsystem@1.5/manual/PlayerInput.html

    Another thing, is the PlayerController class the one your source code snip is from? Basically your PlayerInput component says it is sending BroadcastMessage to the gameobject, which will reach this gameobject and its children. If your controller is on the same gameobject, SendMessage is enough.
     
  4. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    No, just a single PlayerInput.

    Yes, it's on the same object. I think it was working with SendMessage but I was trying some things looking for a fix.

    Thanks for the suggestions. I'm a bit stumped by this one.
     
  5. KillDashNine

    KillDashNine

    Joined:
    Apr 19, 2020
    Posts:
    449
    So your issue is with the gamepad? And this works with the UI? Your actions might be wrongly composed for the gamepad (you can try copy-pasting your working binds from your UI map). But also - how are you switching to the gamepad scheme? Your default scheme is "any". Have you tried to set the gamepad to default scheme, or to switch the scheme from script?

    And sorry, I haven't tried gamepad stuff and am not pro in this, just trying to give you ideas. I haven't had such issues with keys+mouse.
     
    Last edited: Jul 11, 2023
  6. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    I've tried a lot of little things like that yeah.

    I'm going to try creating a new actions set and see if that fixes things.
     
  7. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,769
    Haven't used the PlayerInput component much, but based on the docs it seems to 'pair' itself with devices. Maybe you could debug what devices its pared with: https://docs.unity3d.com/Packages/c...l#UnityEngine_InputSystem_PlayerInput_devices

    Can't really see a way to pair it to a device though.

    Admittedly I find the component a bit much. I've always just hooked into InputAction's directly, such as via an InputActionReference. Though you may lose some of the auto-functionality it gives, especially if you're making a local multiplayer game.