Search Unity

Setting Up UI for Local Multiplayer (player selection)

Discussion in 'Scripting' started by RemDust, Jan 29, 2018.

  1. RemDust

    RemDust

    Joined:
    Aug 28, 2015
    Posts:
    432
    Hi guys, as we all know when we try to implement a local multiplayer UI screen, the event system just sucks.I don't even understand how Unity doesn't have a solution to work with several event system with id's.

    Well, anyway player selection seems like a very commun setup and still I can't wrap my head around it.

    The only viable solution i can see is a very poor one : having a "raw" script for every button/panel/dropdown and calls explicit method for each one of them regardless of the real UI and EventSystem methods...

    How do you guys implement that kind of UI multiplayer scene ??
    Any input would be really appreciated !
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,537
    It's a common challenge, but there is not a common solution. The event system is also not stupid.

    There are many ways to approach local multiplayer character selection screens. I suggest a data driven approach where inputs from controllers modify an index of which character is selected and that player's selector icon simply highlights the given character portrait at that index. I've used that approach and it worked pretty well.

    When all players are 'ready', just start the game with the current character indexes.
     
    parassha97 and RemDust like this.
  3. RemDust

    RemDust

    Joined:
    Aug 28, 2015
    Posts:
    432
    I know that the Event System works just fine in a single player setup, I just think that it kind sucks that you can't easily create a list of event system and link them to different UI element.

    It's interesting but my screen is more complex that this and there will be a nice amount of character customization and stuff. I'm afraid this approach could be messy in the long run :/
     
  4. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
  5. RemDust

    RemDust

    Joined:
    Aug 28, 2015
    Posts:
    432
    Hi man, thank you for your input !
    I spend quit a moment trying to make it work but It seems like I'm missing something.

    My screen is a bit more complex than this exemple, there are dropdown and other stuff (don't event know if it's related or if I'm just a noob)...
    Also I'm using InControl as an Input Manager and it requires to use an alternative version of the ui module input class to deal with UI stuff...

    Anyway after few hours, I'm stuck :(
     
  6. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Sorry I don't really have any more info. Perhaps someone else who's dealt with this before will have more insight. It's not something I've ever put much thought into. I just happened to have remembered that post from before.

    I hope you get it worked out.
     
    RemDust likes this.
  7. RemDust

    RemDust

    Joined:
    Aug 28, 2015
    Posts:
    432
    No pb ! I appreciated your post :)
     
  8. Totoro205

    Totoro205

    Joined:
    Dec 12, 2017
    Posts:
    18
    Hello, I was wondering if you found a solution to your problem, i would appreciate your help as i am facing the same issue..
     
  9. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Did you try what's posted in the other thread linked earlier in this thread?

    I haven't, and some people say it doesn't work but others say it does. =)
     
  10. JasonBruse

    JasonBruse

    Joined:
    May 7, 2019
    Posts:
    5
    I know this is an old thread, but I still could not find a good solution for this. I tried the link example. It didn't work for me.

    Any other solutions?