i want to share a Code to my friend and then that friend join me as a team member.

Hi,

I am working on photon need help with a problem, i want to share a link to my friend and then that friend join me as a team member and then search for opponent online.

How can i achieve this?

Answers

  • If the players know one another's userID, you could use FindFriend to follow a friend: https://doc.photonengine.com/en-us/pun/current/lobby-and-matchmaking/userids-and-friends

    When you exchange a code outside of PUN (because PUN itself does not enable communication outside of rooms), you can exchange this as room name as well. Tell the other the region to use and the room name to join. Both users can use JoinOrCreateRoom(code_or_name) and then wait for the other in-room.

    You can set a room option to create the room as invisible. This prevents others from joining the room by JoinRandom.


    For Teams, please refer to the included scripts in the PUN 2 package. Teams are organized within the room itself (not before/while you join).