I’m trying to run a simple code that will print something when I press the Space Bar. I’m very new to coding, so I apologize if the answer is simple and I overlooked it. The problem is that nothing is being printed in the console when I press the Space Bar.
var MenuScreen : int = 0;
if (MenuScreen == 0) {
if (Input.GetKeyUp(KeyCode.Space)){
print ("Bacon");
}
}
The code where you check if the spacebar is pressed , is it placed within the update method of your script ?
It will likely not be registered by the script because it maybe only run once.
Try adding it to your update method/ function in the case of javascript