- Home /
error CS0012
I am trying to build and run my created game. When I build it it runs fine within Unity. However, when I run and build I keep getting this error relating to my scripts:
Assets/Scripts/Score.cs(7,12): error CS0012: The type UnityEngine.MonoBehaviour' is defined in an assembly that is not referenced. Consider adding a reference to assembly
UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
The code it is referencing is a c# class that I made to keep track of the player's score. I will copy and paste my code below.
using UnityEngine; using UnityEngine.UI;
public class Score : MonoBehaviour {
public Transform player;
public Text scoreText;
// Update is called once per frame
void Update () {
scoreText.text = player.position.z.ToString("0");
}
}
I have the exact problem. Following a Brackeys tutorial?
Your answer
Follow this Question
Related Questions
I can't build a game for android 2 Answers
Not pushing content to device 0 Answers
Build & Run won't finish 0 Answers
Unity error when build (antivirus On) 0 Answers
Unity is broken completely 1 Answer