Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity key down

//returns bool
//true if key was up last frame, but now is pressed
Input.GetKeyDown(KeyCode.Space)
//true while key is not pressed (key is up)
Input.GetKeyUp(KeyCode.Space)
//true while key is down
Input.GetKey(KeyCode.Space)
 
PREVIOUS NEXT
Tagged: #unity #key
ADD COMMENT
Topic
Name
6+3 =