Input.GetMouseButtonDown(0) is only detecting one click

So i’m trying out a tutorial on how to use unity, and I’ve run into a problem. I’m trying to use Input.GetMouseButtonDown(0) to detect when the mouse button has clicked on either blank space or an object, but no matter what it will only detect 2 clicks total (one for not hitting an object, and one for hitting one). Here is the code I’ve got:

function Update()
{
	//want to use the left mouse button to select on 
	//game objects in the scene
	if(Input.GetMouseButtonDown(0))
	{
		print("Yes the button works");
		var hit : RaycastHit;
		var ray : Ray = Camera.main.ScreenPointToRay(Input.mousePosition);
		if(Physics.Raycast(ray, hit, 100.0))
		{
			print("You hit an object");
			
		}
	}
}

Has the way that GetMouseButtonDown(0) works changed? or is there something i’m missing in my code here (also, the tutorial I’m following is here: 5 03 scripting player raycast on Vimeo in case that helps)

Turn off “collapse” in the console, or look at the number at the right which tells you how many times a particular message was generated.

MouseButtonDown is only supposed to be true if the button has just changed from being 0 to being 1. IF you are looking for something to always return true if the mouse is down, look up the unity documentation on “Input” and find the appropriate function.