Hi There,
I am working on an F2P FPS game but i get Assets/NetworkManager.cs(40,20): error CS0103: The name `SpawnSpots’ does not exist in the current context.
Can you help me how to fix this
using UnityEngine;
using System.Collections;
public class NetworkManager : MonoBehaviour {
public Camera standbyCamera;
SpawnSpot[] spawnSpot;
// Use this for initialization
void Start () {
spawnSpot = GameObject.FindObjectsOfType<SpawnSpot>();
Connect ();
}
void Connect() {
PhotonNetwork.ConnectUsingSettings ("BlackOut Online v001");
}
void OnGUI() {
GUILayout.Label ( PhotonNetwork.connectionStateDetailed.ToString() );
}
void OnJoinedLobby() {
Debug.Log ("OnJoinedLobby");
PhotonNetwork.JoinRandomRoom();
}
void OnPhotonRandomJoinFailed() {
Debug.Log ("OnPhotonRandomJoinFailed");
PhotonNetwork.CreateRoom ( null );
}
void OnJoinedRoom() {
Debug.Log ("OnJoinedRoom");
SpawnMyPlayer ();
}
void SpawnMyPlayer() {
if(SpawnSpots == null) {;
Debug.LogError ("WTF?!?!?");
return;
}
SpawnSpot mySpawnSpot = spawnSpot[ Random.Range (0, spawnSpot.Length) ];
PhotonNetwork.Instantiate("First Person Controller", mySpawnSpot.transform.position, mySpawnSpot.transform.rotation, 0);
standbyCamera.enabled = false;
}
}