KeyCode.Enter

Hey guys. I’ve been having trouble figuring out how to make an if statement that detects when the “enter” key is pressed. I wrote this simple script but it won’t work. Any help?

function Update() {
	if(Input.GetKeyDown (KeyCode.Enter))
	{
		Debug.Log("Enter");
	}
}

It’s KeyCode.Return, KeyCode.Enter refers to the button on the Num Pad.

Try this
Input.GetKey(KeyCode.Return)