- Home /
How to join all the players to the same room in photon Unity Offline Mode?
I have designed a multiplayer game in Unity 3D using Photon Unity Network plugin for multiplayer gaming. It is working fine in the online mode. I want the same multiplayer game running offline without the Photon cloud. I want all the players to join to the same room. But when I run the code below I can see only my player but not any other player.
void Start () {
spawnSpots =GameObject.FindObjectsOfType<SpawnSopt>();
Connect ();
//PhotonNetwork.CreateRoom("my");
PhotonNetwork.JoinRoom("my");
SpawnMyPlayer();
}
void SpawnMyPlayer(){
if (spawnSpots == null) {
Debug.Log("No SpawnSpots Found");
return;
}
SpawnSopt mySpawnSpot = spawnSpots[Random.Range(0,spawnSpots.Length)];
GameObject myPlayerGO = (GameObject) PhotonNetwork.Instantiate ("PlayerController", mySpawnSpot.transform.position, mySpawnSpot.transform.rotation, 0);
((MonoBehaviour)myPlayerGO.GetComponent ("ThirdPersonController")).enabled = true;
((MonoBehaviour)myPlayerGO.GetComponent ("ThirdPersonCamera")).enabled = true;
}
I am trying to join all the players to the same exact room. But why it is not happening?
Please note that I am talking about Photon offline mode and I don't want to make my game single player. I want an offline multiplayer game.
Thanks in advance.
why are you using photon if u want offline game ? just make no. of bots u want and intantiate them at random spawnpoints and handle there respawn on deaths etc
@abhijeet1001 can you please make it a bit more detail. I am new to game program$$anonymous$$g. And also if you can suggest me a tutorial for this it will be really helpful.
i am not sure mate i am new to unity too so i am not sure how to get it working , but the logic behind my answer was you dont need photon for you offline game you can handle it your self without needing photo just create a variable for no. of bots and make that many number of prefabs using script and spawn them randomly on your spawn points its not hard to do will need little bit of research as i am not familiar with much of the functions and commands but can be done pretty easily problem you will face with offline fps will be making AI move and attack etc
Your answer
Follow this Question
Related Questions
Photon Networking (Viking Demo) - GetRoomList() func not working 2 Answers
Can we use "Photon cloud" for a card game like poker in Unity3d? 1 Answer
Using Photon to Send Screenshot to other Players 0 Answers
Getting an "Unknown Resolve Error" with Photon.MonoBehaviour 1 Answer
How to check Time when player is join the room in Unity Photon Networking 1 Answer