Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Adding PlayerInput component disables Player#0 actions

Discussion in 'Input System' started by Mawkey, May 11, 2021.

  1. Mawkey

    Mawkey

    Joined:
    Apr 15, 2018
    Posts:
    15
    Upon starting the game, the input debugger shows all actions on Player#0 as disabled.
    This only happens when using the PlayerInput component.



    Does anyone have any insight on this?
     
  2. jukibom

    jukibom

    Joined:
    Aug 31, 2015
    Posts:
    54
    That's curious, mine doesn't start disabled but I do toggle them for various things.

    Does this work?

    Code (CSharp):
    1.         var playerInput = GetComponent<PlayerInput>();
    2.         playerInput.ActivateInput();
     
  3. Mawkey

    Mawkey

    Joined:
    Apr 15, 2018
    Posts:
    15
    I've tried that before, but I tried it again just to be safe. Sadly it has no effect at all. If I don't use the PlayerInput component and only the UIInputModule, everything works fine.
    The only reason I use PlayerInput is because I couldn't get rebinding keys to work without it for some reason...

    Thanks for the reply though, getting any help on this issue seems difficult.
     
  4. jukibom

    jukibom

    Joined:
    Aug 31, 2015
    Posts:
    54
    Ya I know what you mean, all feels a little wild west right now huh? :p

    What does your PlayerInput component look like? Here's mine
    upload_2021-5-12_17-11-57.png

    I've moved all my bindings over to a new "Everything" scheme because it's the kind of game where users tend to mix and match devices (flight sim) but you shouldn't need to do any of that.

    Here's my Input Manager preferences too if it gives you any clues.

    upload_2021-5-12_17-13-20.png
     
  5. Mawkey

    Mawkey

    Joined:
    Apr 15, 2018
    Posts:
    15


    Looks pretty much the same. Do you have any main menu where you can rebind the keys? I think the problem is some kind of interaction with PlayerInput and the InputSystemUIInputModule.

    UIInputModule drives the UI interactions for me and PlayerInput handles rebinding and keeps them persistent to the next scene via DontDestroyOnLoad.