GetKey vs GetKeyDown?

GetKey means returns true while I’m pressing the designated key and GetKeyDown means you press the designated key once? In the example we use Input.GetKeyDown(KeyCode.L) (and i assume we press it once) to load next level?

1 Like

Correct. GetKey() will return true in every frame that the key is held down while GetKeyDown() only returns true in the first frame that is is pressed, then false after that even if the key is still down - which it is rather often because the frames can, and do, happen multiple times in the moment we press a key.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms