I’m trying to make a game with some sort money generator:
public GameObject Circle; //The Gameobject with the script
public move script;//The Script I want to access
void Start()
{
script = Circle.getComponent<move>();
StartCoroutine(Example()); //A Timer
}
IEnumerator Example()
{
yield return new WaitForSeconds(5); //Wait 5 Seconds
script.money += 50;//more Money
}
I’m getting the error:
error CS1061: 'GameObject' does not contain a definition for 'getComponent' and no accessible extension method 'getComponent' accepting a first argument of type 'GameObject' could be found