- Home /
Console game isn't working.
Hey, i was editing my console game just to train my Csharp And i have a problem, one time after i was editing a script i saved and exited and the next day i went on and nothing was showing up on the console. i hope you can help, thanks.
Scrip CSharp:
using UnityEngine; using System.Collections;
public class NumberWizard : MonoBehaviour {
// Use this for initialization
int max;
int min;
int guess;
void Start () {
StartGame();
}
void StartGame () {
max = 1000;
min = 1;
guess = 500;
print ("========================");
print ("Welcome To Number Wizard");
print ("Pick a number in your head, But don't tell me!");
print ("The highest number you can pick is " + max);
print ("The lowest number you can pick is " + min);
print ("Is the number lower or higher then " + guess);
print ("Up = higher, Down = Lower Return = equal");
max = max + 1;
}
void NextGuess() {
guess = (max + min) / 2;
print ("Higher or lower then " + guess);
print ("Up = higher, Down = Lower, Return = equal");
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown (KeyCode.UpArrow)) {
min = guess;
NextGuess();
} else if (Input.GetKeyDown (KeyCode.DownArrow)) {
max = guess;
guess = (max + min) / 2;
print ("Higher or lower then " + guess);
}else if (Input.GetKeyDown (KeyCode.Return)) {
print("I won!!");
print("Want to play again? Press space");
}else if (Input.GetKeyDown (KeyCode.Space)) {
StartGame();
}
}
}
Is this script attached to an active gameobject in the scene? And is the script enabled?
@JedBeryll So sorry for the late reply it didnt notify me of the reply until now,
The only gameobject in the scene is the camera, and im not sure if it is, And the script should be enabled but im not sure, Im quite new to this So i hope you can help :)
And when it was working and i clicked play to test it it had a black screen but now it turned blue
Your answer
Follow this Question
Related Questions
strange error 1 Answer
Error after importing assets (Survival Shooter tutorial), Win32Exception 0 Answers
Any way to locate an error with filename unknown? 0 Answers
a console statement appeared and I have no clue how to solve it 0 Answers
Imported project issues,Imported Project Build Issues 0 Answers