I am new to Unity, and I have this error:
UnityException: Tag speed1 is not defined!
Even though I clearly defined it. Did I do something wrong?
public class Level1Speed : MonoBehaviour {
public float speed = 60;
void Start() {
tag = "speed1";
}
}
public class nomNomScript : MonoBehaviour {
GameObject speedFinder;
Level1Speed lvlSpeed;
private float speed = 60;
void Start() {
speedFinder = GameObject.Find("speed1");
lvlSpeed = speedFinder.GetComponent<Level1Speed>();
}
void FixedUpdate() {
speed = lvlSpeed.speed;
edit: Nevermind, I just realized that I renamed my class in Unity, but didn’t actually change the name in my code.