Search code examples
c#unity-game-enginemonomultiplayerphoton

Local network multiplayer game with unity


I followed a tutorial link to create a multiplayer first person shooter game using Unity 3D. It uses Photon Unity Networking plugin. The games works fine. But the problem is it uses the Photon cloud. I want to convert this to an offline multiplayer game. Then I can use my LAN network or local Wi-Fi router to transfer game data. I need something like Call of Duty multiplayer. Is it possible to do it with Photon Unity Networking. If possible how to do that? What should I change in my code? Can you please suggest any tutorials on offline multiplayer game designing using Unity 3D. As I am quite new to programming please give me a detailed answer.

Multiplayer first person shooter tutorial link: link


Solution

  • In the Photon Server Settings set the hosting mode to offline and try this code.

    void Start () {
    
            Connect ();
            PhotonNetwork.JoinRoom("room1");
            //Create your player
        }
    
    void Connect(){
            PhotonNetwork.ConnectUsingSettings ("your settings");
        }