Assets/Scripts/NetworkManager.cs(47,48): error CS0120: An object reference is required to access non-static member `PhotonView.isMine'

Please help! The lead programmer in our team thought I should learn programming (I’m an artist/modeler). I’m using quill18creates’ tutorial to make a multiplayer fps in unity. Just something simple, not anything major. I’m really stuck right now, and I can’t figure out what’s wrong. I realize similar questions have been asked before, but I’m too stupid to understand anything.

using UnityEngine;
    using System.Collections;
    public class NetworkManager : MonoBehaviour {
    	SpawnSpot [] spawnSpots;
    	// Use this for initialization
    	void Start () {
    		spawnSpots = GameObject.FindObjectsOfType<SpawnSpot> ();
    		Connect ();
    	// Update is called once per frame
    	void Update () {
    	void Connect () {
    		PhotonNetwork.ConnectUsingSettings ("v0.0.1");
    	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() {
    				SpawnSpot mySpawnSpot = spawnSpots [Random.Range (0, spawnSpots.Length)];
    				GameObject myPlayerGO = (GameObject)PhotonNetwork.Instantiate ("Capsule", mySpawnSpot.transform.position, Quaternion.identity, 0);
    				Debug.Log ("Instantiated");
    				if (PhotonView.isMine) {
    						((MonoBehaviour)myPlayerGO.GetComponent ("Player Movement")).enabled = true;
    						((MonoBehaviour)myPlayerGO.GetComponent ("Playerlook Script")).enabled = true;
    						((MonoBehaviour)myPlayerGO.GetComponent ("Mouse Look Script")).enabled = true;

I’ve tried everything I can think of. Nothing seems to work.

Also note that the other scripts are JavaScript, whereas this one’s C#

a) Double check the name of the scripts. Spaces etc.

b) replace

((MonoBehaviour)myPlayerGO.GetComponent ("Player Movement")).enabled = true;


myPlayerGO.GetComponent(Player Movement).enabled = true;

Thanks! I’ll try this right now!