Problem with the new input system (793622)

Actually I believe the question itself is quite simple, but I can’t somehow find any answer to it. Anyway, the question is, I have a local multiplayer game with up to 4 controllers (4 players) that can connect at the same time, which works absolutely fine. And every code worked as intended. But the problem appears when I was coding for a character select screen.
I don’t know how to let the player quit.
I mean, the function works like this:

  1. Unity waits for a button press, which can be any button pressed by any controller.
  2. If a button is pressed and it’s coming from a new controller it will be assigned as a new player. Start from player 1, and so on. Then they can start to choose their character.
    The above works just fine, then the real problem came.
  3. If a player which is already a “Player” press the “LeaveButton”, that player will be cleared and should work like the controller had disconnected, and can re-join if he wants to by pressing the join button again.
    I don’t know how to let the player quit.
    I tried using Destroy(gameObject), but that didn’t make the player “quit”, it just makes him disappear.
    Currently, I’m still trying to figure out what should I do, but haven’t found anything useful though.
    I will be happy if someone can help me out on this one.

I have the same exact problem and I can’t seem to find any answers

You necro’d a thread from a year ago because you aren’t smart enough to find the forum dedicated to the new input system?

1 Like