I am currently working on a new Parkour Simulator MMO, but the spawns are broken. This is the error I am recieving.
Assets/Prefabs/scripts/NetworkManager.cs(42,41): error CS0103: The name `spawnSpots' does not exist in the current context
This is appearing as 3 errors, still the same one but with different lines.
Here is the code.
using UnityEngine;
using System.Collections;
public class NetworkManager : MonoBehaviour {
public Camera standbyCamera;
// Use this for initialization
void Start () {
spawnSpots = GameObject.FindObjectsOfType<SpawnSpot> ();
Connect ();
}
void Connect() {
PhotonNetwork.ConnectUsingSettings("1.0.0");
}
void OnGUI () {
GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString ());
}
void OnJoinedLobby() {
Debug.Log ("Joined");
PhotonNetwork.JoinRandomRoom ();
}
void OnPhotonRandomJoinFailed() {
Debug.Log ("Failed");
PhotonNetwork.CreateRoom( null );
}
void OnJoinedRoom() {
Debug.Log ("Joined");
SpawnMyPlayer ();
}
void SpawnMyPlayer() {
if (spawnSpots == null) {
Debug.LogError ("ERROR ERROR");
return;
}
SpawnSpot mySpawnSpot = spawnSpots [Random.Range (0, spawnSpots.Length)];
PhotonNetwork.Instantiate ("PlayerController", mySpawnSpot.transform.position, mySpawnSpot.transform.rotation, 0);
standbyCamera.enabled = false;
}
}
Please help?