April 2018
Beginner
468 pages
11h 7m
English
If you have a button defined as an axis in the Input Manager, you can use GetButton(), GetButtonDown(), and GetButtonUp() to determine when a button has been pressed.
GetButton() returns true while the button is being held, GetButtonDown() returns true only once, on the frame that the button is initially pressed, and GetButtonUp() returns true only once, on the frame that the button is released.
Within each of the functions, you place the axis name from the Input Manager within the parentheses within quotes. These functions should be checked in the Update() function of a script so that they are continuously being checked for.
So, for example, if you wanted to check whether the Enter key is being pressed since it is assigned to a ...