Private room



  • I want the player to create their own private room. I already created the proper UI for it and the script, which allows the user to create the room and pick between TDM OR CTF. However, I am stuck on the following.
    When the player enters the scene, no tanks spawn. How can we combine both scripts? The online mode and the create room that I implement. or do you have any tips on how to modifying the NetworkManagerCustom script to allow users to create their room. If yes, steps will be appreciated. I really appreciate any help you can provide. scripts



  • It's not very clear what you mean by "private room". Regardless of the network provider used, if there are no available rooms online, the player creates its own room already. It is then listed on the matchmaking service - this is something you can prevent by using a room property, for example.

    In the case of Photon, there are a few ideas in that thread:
    https://forum.photonengine.com/discussion/2303/create-private-rooms

    When the player enters the scene, no tanks spawn.

    I hope you do not mean bot tanks, because they are not supported in online mode. For further guidance on which methods to use, I would need to know which networking provider (out of the 3) you are using.



  • Thank you so much for your fast response. I do not mean bot tanks. All I want to do is allow the users to choose between "Quick Match" or creating their own room to play with friends (Room Name). In the console, I thought it said that if there is no available room, Photon will create one. So, what I want to do is allow the user to be to create their own room, so that they can play with their friends privately. Any help will be appreciated.



  • There is actually a sample on the official PUN docs for just that:

    https://doc.photonengine.com/en-us/pun/current/lobby-and-matchmaking/matchmaking-and-lobby#play_with_your_friends

    As mentioned on that page, have your button call PhotonNetwork.JoinOrCreateRoom with a room ID that can be shared with other people.


Log in to reply