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’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

two-player match

Discussion in 'Multiplayer' started by Zeohack, Jun 9, 2021.

  1. Zeohack

    Zeohack

    Joined:
    Sep 17, 2020
    Posts:
    12
    Hi guys.. I have a game played for 2 players (1vs1) what I want is when a player says play, the opponent will call while searching for another player to match the two of them or any two players, and then they start the match, can I do this with PUN2 or try other ways need?
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,013
    Yes, PUN 2 has matchmaking built in.
    You can use the ConnectAndJoinRandom script to do this. Make sure to set the MaxPlayer value to 2 and you're good.
     
    Zeohack likes this.
  3. Zeohack

    Zeohack

    Joined:
    Sep 17, 2020
    Posts:
    12
    this is good thanks
     
  4. Zeohack

    Zeohack

    Joined:
    Sep 17, 2020
    Posts:
    12
    Can I use the rock paper demo in pun 1 in pun 2 to get some examples and adapt it to my own game?
     
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,013
    Zeohack likes this.