No Character Spawns And The Game Screen Goes Black Why???
The Code Is:
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 ();
}
// Update is called once per frame
void Connect () {
PhotonNetwork.ConnectUsingSettings ("V1");
}
void OnGUI () {
GUILayout.Label (PhotonNetwork.connectionStateDetailed.ToString ());
}
void OnJoinedLobby (){
PhotonNetwork.JoinRandomRoom ();
}
void OnPhotonRandomJoinFailed (){
PhotonNetwork.CreateRoom (null);
}
void OnJoinedRoom (){
SpawnMyPlayer ();
}
void SpawnMyPlayer (){
if (spawnSpots == null) {
Debug.LogError("WTF??");
return;
}
SpawnSpot mySpawnSpot = spawnSpots[Random.Range(0,spawnSpots.Length)];
PhotonNetwork.Instantiate ("PlayerController",mySpawnSpot.transform.position,mySpawnSpot.transform.rotation,1);
standbyCamera.enabled = false;
}
}