Failing to understand Input.GetButton()

I’ve got a very simple piece of code but it doesn’t go as well as expected. Every time I press the “Up” button I want to get a Console message.

void Start() {}

void Update () {
	if (Input.GetButton("Up"))
		Debug.Log("Hey");
}

If i’m pressing right at the first second on the “Up” button it works fine, after that I’m getting no response.
What’s wrong ?

I prefer “KetGey” for this sort of thing…

void Update () {
if (Input.GetKey("up")){
Debug.Log("Hey");
}

Should print to console every frame, whereas:

void Update () {
if (Input.GetKeyDown("up")){
Debug.Log("Hey");
}

Would print only when you pressed the button, not continually printing.

Yup, working now!

Thank you very much, I’m sure it’s good for your Karma :slight_smile: