[Solved] (42,18): error CS1525: Unexpected symbol (‘, expecting,’, ;’, or= [closed]


You’ve nested the time() function inside of timeAdd(), and I’m assuming you don’t have C# 7 support for local functions. Pull the time() function out of timeAdd() to look like this:

private void timeAdd(){
    seconds += 1;
    if(seconds >= 60){
        minutes = 1;
    }

    if(minutes >= 60){
        hours = 1;
    }

    if(hours >= 24){
        days = 1;
    }

    if(days >= 365){
        year = 1;
    }
}

IEnumerator time() {  // Its in this line there is an error.
    while (true){
        timeAdd();
        yield return new WaitForSeconds(1);
    }
}

0

solved (42,18): error CS1525: Unexpected symbol (‘, expecting,’, ;’, or= [closed]