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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question How do I divide and determine different players in UI?

Discussion in 'Input System' started by henkdg, Jul 7, 2023.

  1. henkdg

    henkdg

    Joined:
    Oct 26, 2021
    Posts:
    3
    Hello everyone,


    I'm using the new unity input system and I want to make a UI that can detect which controller pressed a button, I would like a player divided UI experience. So basically I want to make it so that everybody can control the UI, but on the character screen I want to be able to determine who pressed the hovered over character so that they can later in another scene become that character and also I would like that once you have chosen your character that your player number apears next to the character and that your controller gets locked, but only yours meaning that the other players can still chose their characters. After everybody has chosen their character the start button would become clickable and player 1 can then press play.


    I can think of some janky workarounds, but I know what I want is possible. I really hope that someone is able to clarify how I can do it. I'm a experienced programmer so writing a lot of code won't stand in my way, I just have no clue where to start cause the new input system is quite complicated. I don't want to over complicate my code so that's why I'm reaching out for help. I will attach an picture of the character selection screen so that it become more clear what I want.


    If I need to clarify something please ask me!
     

    Attached Files:

  2. henkdg

    henkdg

    Joined:
    Oct 26, 2021
    Posts:
    3
    No worry's anyone, I spent an entire day reading the input documentation and managed to create a system that allows players to join and pick a character. I also added a option that disables the keyboard and mouse input. I will post another reply tomorrow explaining my methode.