Print statement to execute multiple times

I want my script to print every time i press space. How should i do this?

The following code only prints “space pressed” regardless of the amount of times space is acutally pressed:

void Update () 
	 {
		if(Input.GetKey("space"))
		{
            //This does not run more than once
			print("space pressed");
		}
	}

Turn off collapse in the console, or just look at the indicator in the console that shows how many times an identical line was printed. Also, you should use GetKeyDown, otherwise GetKey returns true every frame the key is down.

void Update ()
{
if(Input.GetKey(“space”))
{
//This does not run more than once
debug.log(“space pressed”);
}
}