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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Input system- new joining player problem

Discussion in 'Input System' started by Grzp, Feb 15, 2022.

  1. Grzp

    Grzp

    Joined:
    Jan 25, 2018
    Posts:
    31
    Hi all,
    I want to ask about joining new players to the game. I have this settings in Input Manager:
    upload_2022-2-15_15-34-30.png
    Is there posibility to get information in HandlePlayerJoin funtion with which button new Player joined?
     
  2. Grzp

    Grzp

    Joined:
    Jan 25, 2018
    Posts:
    31
    Of course, parameter od function HandlePlayerJoin is player input from device on which button was pressed.
     
  3. LeonidDeveloper

    LeonidDeveloper

    Joined:
    Jan 23, 2021
    Posts:
    17
    I think that the new input system is not intended for direct interaction with buttons. You need to use actions. The first callback from the InputManager will show the action (phase == InputActionPhase.Started). But usually not every button is associated with an action.
     
  4. Grzp

    Grzp

    Joined:
    Jan 25, 2018
    Posts:
    31
    Yeah, I know, I use actions. I have a Input Sytem asset:
    upload_2022-2-16_10-15-28.png
    And I want to for example debug it like this:
    upload_2022-2-16_10-19-43.png
    In both debug I get false. I think that happens because when function HandlePlayerJoin is called, the button isn't longer pressed. So I try debug get infromation with what button (action) player join or which button (action) was pressed.
     

    Attached Files: