[Solved] CreateRoom Error/Issue

Hey all, I have an issue when using Photon cloud.. Whenever I try to create a room my game just does nothing. No matter what debugging I do. Nothing happens.

Anyone got any light on this?

Console/debugging helps in no way :(
IiyNEmL.png


[code2=csharp]using UnityEngine;
using System.Collections;

public class NetworkManager : MonoBehaviour {

public Camera standbyCamera;
SpawnSpot[] spawnSpots;

// Use this for initialization
void Start () {
spawnSpots = GameObject.FindObjectsOfType<SpawnSpot>();
Connect ();
}

void Connect() {
Debug.Log("Connect");
PhotonNetwork.ConnectUsingSettings( "0.0.5" );

}

void OnGUI() {
GUILayout.Label( PhotonNetwork.connectionStateDetailed.ToString() );
}

void OnJoinedLobby() {
Debug.Log("OnJoinedLobby");
PhotonNetwork.JoinRandomRoom();
}

void OnPhotonRandomJoinFailed() {

Debug.Log("OnPhotonRandomJoinFailed");
CreateRoom ();


}

void OnPhotonCreateGameFailed() {
Debug.Log("OnPhotonCreateGameFailed");
}




void OnJoinRoom() {
Debug.Log("OnJoinRoom");

SpawnMyPlayer ();

}

void SpawnMyPlayer() {
Debug.Log("SpawnMyPlayer");
if(spawnSpots == null) {
Debug.LogError ("No Spawn Spots were found!");
return;
}

SpawnSpot mySpawnSpot = spawnSpots[Random.Range (0, spawnSpots.Length) ];

PhotonNetwork.Instantiate("PlayerController", mySpawnSpot.transform.position, mySpawnSpot.transform.rotation, 0);
standbyCamera.enabled = false;
}

void CreateRoom() {
Debug.Log("CreateRoom");
PhotonNetwork.CreateRoom( null );
}

}[/code2]

Any help is appreciated!

Comments

  • Nevermind.. I put "OnJoinRoom" instead of "OnJoinedRoom".. Patched it now.. Thanks anyway guys.
  • I'm sorry you ran into that problem.
    In some cases, it's really annoying that we don't have definitions for the callbacks. An Interface would define these things but then you would always have to fully implement all methods in the interface...