Unexpected symbol error message keeps persisting

So here are the errors in question

Assets/scripts/NumberWizard.cs(29,1): error CS8025: Parsing error

Assets/scripts/NumberWizard.cs(19,9): error CS1525: Unexpected symbol `)’

and here is the script in question

using UnityEngine;
using System.Collections;

public class NumberWizard : MonoBehaviour {

// Use this for initialization
void Start () {
print ("welcome to Number Wizard");
print ("Pick a number but don't tell me!!");

int max = 1000;
int min = 1;

print ("the biggest number you can pick is " + max);
print ("the smallest number you can pick is " + min);
print ("is the number higher or lower than 500?");
print ("up arrow means higher, down arrow means lower, enter means equal");

)

}

// Update is called once per frame
void Update () {
	if (Input.GetKeyDown(KeyCode.UpArrow)) {
		print ("you pushed the down arrow");
	}
}

}

I have no idea how it keeps happening.

Hi, check 19 line. You have an extra symbol there

Upd.
Errors normally contain a place where error happens. It’s a good place to start with

well I do know that, and I’ve been checking 19 and well I looked at the place the error was and… I saw nothing… I did some work though and, somehow I managed to get rid of those errors but now it says that there is a parsing error on 27.

using UnityEngine;
using System.Collections;

public class NumberWizard : MonoBehaviour {

	// Use this for initialization
	void Start () {
	print ("welcome to Number Wizard");
	print ("Pick a number but don't tell me!!");
	
	int max = 1000;
	int min = 1;
	
	print ("the biggest number you can pick is " + max);
	print ("the smallest number you can pick is " + min);
	print ("is the number higher or lower than 500?");
	print ("up arrow means higher, down arrow means lower, enter means equal");
	
	
	
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetKeyDown(KeyCode.UpArrow)) {
		print ("you pushed the down arrow"); }
using UnityEngine;
using System.Collections;

public class NumberWizard : MonoBehaviour
{

    // Use this for initialization
    void Start()
    {
        print("welcome to Number Wizard");
        print("Pick a number but don't tell me!!");

        int max = 1000;
        int min = 1;

        print("the biggest number you can pick is " + max);
        print("the smallest number you can pick is " + min);
        print("is the number higher or lower than 500?");
        print("up arrow means higher, down arrow means lower, enter means equal");
}

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            print("you pushed the down arrow");
        }
    }
}

normally with that formatting there should not be any kinds of parcing problems

See, that’s why I don’t like putting the open bracket at the end of the
line. It should have it’s own line in the proper bracketing to be make it
easier to track your indentations and blocks.
Anyway, I saw at first that there was a close parenthesis instead of a
bracket. Not sure what happened after that.

Alright so it says I have a parsing error on line 28, that’s the last one… but the thing is that from what I’m aware of there needs to be an end bracket. and the only thing at the end is an end bracket.

using UnityEngine;
using System.Collections;

public class NumberWizard : MonoBehaviour {

	// Use this for initialization
	void Start () {
	print ("welcome to Number Wizard");
	print ("Pick a number but don't tell me!!");
	
	int max = 1000;
	int min = 1;
	
	print ("the biggest number you can pick is " + max);
	print ("the smallest number you can pick is " + min);
	print ("is the number higher or lower than 500?");
	print ("up arrow means higher, down arrow means lower, enter means equal");
	
	
	
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetKeyDown(KeyCode.UpArrow)) 
		{
		print ("you pushed the down arrow"); 
		}

Well, from what’s on the email here, you’re missing two brackets. One for
the Update method, and one for the class.

Okay so I understand what update means, but I don’t really understand what class means

At the top of your script (class) you will see the line;
public class NumberWizard : MonoBehaviour {

This is the class definition, you will note you having an opening curly brace.

For each opening { or ( characters you need to ensure you have the corresponding closing character.

Alright so I added another bracket at the end here but the error still persists

public class NumberWizard : MonoBehaviour {

	// Use this for initialization
	void Start () {
	print ("welcome to Number Wizard");
	print ("Pick a number but don't tell me!!");
	
	int max = 1000;
	int min = 1;
	
	print ("the biggest number you can pick is " + max);
	print ("the smallest number you can pick is " + min);
	print ("is the number higher or lower than 500?");
	print ("up arrow means higher, down arrow means lower, enter means equal");
	
	
	}
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetKeyDown(KeyCode.UpArrow)) { 
		print ("you pushed the down arrow");
		}
	}

You have an additional closing curly brace for the Start() method you dont need.

The closing curly brace for the class needs to be at the end of your script, e.g to close the class.

Also, it would help those who are trying to help.you if you apply code formatting to your posts, see below.


See also;

Alright so I finally managed to fix it, thank you everyone

1 Like

Privacy & Terms