Nothing coming up in console? [Solved]

Hi! I feel like i’v done my code correctly on this lecture however nothing is coming up in the console.
Here is my code:

using UnityEngine;
using System.Collections;

public class NumberWizard : MonoBehaviour {

	// Use this for initialization
	void Start () {
		print ("Welcome to Number Wizard");
		print ("Pick a nunber 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 arrow = Higher / Down arrow = Lower / Enter = Perfect");
	
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetKeyDown(KeyCode.UpArrow)) {
			print("Up arrow was pressed");
		}
		
		if (Input.GetKeyDown(KeyCode.DownArrow)) {
			print("Down arrow was pressed");
		}
		if (Input.GetKeyDown(KeyCode.Return)) {
			print("I won!");
		}
	}
}

From when i click play nothing comes up
image

Hi! You need to have a game object with the NumberWizard.cs script attached as a component in your scene for it to work :wink:

You can right click in your hierarchy, select “Create Empty”, name it NumberWizard (if you wish, this isn’t necessary) and then click and drag your NumberWizard script onto it.

Thanks i was going crazy over this. Much apreciation!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms