Gets the pressed state of the specified button and stores it in a bool variable.
Button Name
The name of the button. Set in the Unity Input Manager.
Store
Store the button state in a bool variable.
NOTES
Button Names are defined in the Unity Input Manager.
For example:
Control | Primary | Secondary |
---|---|---|
Fire1 | left ctrl | left mouse button |
Fire2 | left alt | right mouse button |
Fire3 | left cmd | middle mouse button |
Since the Input Manager defines keyboard and mouse mappings there is some overlap with other actions like Get Mouse Button and Get Key.
You can also use the Input Manager to map game controller inputs. For example:
XBox Controller: http://wiki.unity3d.com/index.php?title=Xbox360Controller