Hi i’m quite new to unity c# scripting and I am stuck with this error. I keep trying to access the coinController.points variable from another script but it just shows me the “An object reference is required to access non-static member” error.
using UnityEngine;
using System.Collections;
public class PlanningStage : MonoBehaviour {
public string startgame;
public bool hasProtein;
public int totalCoin = 0;
public void newLevel(){
Application.LoadLevel (startgame);
}
void start () {
coinController points = GetComponent<coinController>();
totalCoin += coinController.points;
hasProtein = false;
}
// Update is called once per frame
void Update () {
}
}