Compiler errors stop from playmode?

This is my code. I get the sentence, “All compiler errors have to be fixed before you can enter playmode!”

using UnityEngine;
using System.Collections;

public class NumberWizards : MonoBehaviour {

// Use this for initialization
void Start () {
	print("Welcome to NumberWizard");
	print ("Pick a number in your head, but don't tell me!");
	
	int max = 1000;
	int min = 1;
	print ("The highest number you can pick is " + max);
	print ("The lowest number you can pick is " + min); 
	
	print ("Is the number higher or lower than 500?");
	print ("Up = higher, down = lower, return = equal");
	Input 
}

// Update is called once per frame
void Update () {
	if (Input.GetKeyDown(KeyCode.UpArrow)) {
		print("Up arrow pressed");
	}
	
	if (Input.GetKeyDown(KeyCode.DownArrow)) {
		print("Down arrow pressed");
	}
}

}

What does this mean? How do I fix it?

Before you can run your game the code you write needs to be compiled or to put it another way translated to something the computer understands. In your code there is an error which is preventing this translation.

In the program you are using to program usually the place where this error is located, or the place near it you will see that something is underlined with a squigly line. Also normally in Unity in the console it will mention the code file you should be looking in and a line number.

Good luck!

At the end of your Start() method you have the word Input, remove this and the error should be resolved.

Privacy & Terms