Hello
Excuse me if there is a simple answer to this, for I am not experienced with C# and am more comfortable with Javascript but for some reason I keep getting the error error CS0118: New_Career.Fame' is a
field’ but a `type’ was expected. I have had problems with this piece of code before but I cannot find an answer on the web or Unity Answers. I am trying to access a public variable from my other script “Career_Variables”
Here is my code
using UnityEngine;
using System.Collections;
public class New_Career : MonoBehaviour {
int Fame = GameObject.Find("NewCareerText").GetComponent<Fame>();
int Fame_level = GameObject.Find("NewCareerText").GetComponent<Fame_level>();
int money = GameObject.Find("NewCareerText").GetComponent<money>();
int Races_Completed = GameObject.Find("NewCareerText").GetComponent<Races_Completed>();
int Races_won = GameObject.Find("NewCareerText").GetComponent<Races_won>();
int Races_lost = GameObject.Find("NewCareerText").GetComponent<Races_lost>();
// Use this for initialization
void OnMouseEnter ()
{
gameObject.renderer.material.color = new Color(0,0,0);
}
// Update is called once per frame
void OnMouseExit()
{
gameObject.renderer.material.color = new Color(255,255,255);
}
void OnMouseDown()
{
Application.LoadLevel ("Career");
}
}
Thank you in advance for your help and if there are any details I have left out please tell me