how to get keys pressed and hekd in unity code example
Example 1: How to hold key down unity
// If Key Is Held Down
Input.GetKey("Key")
// If Key Is Held Down With if Statement
if (Input.GetKey("Key"))
{
// Whatever is in this will get called when "Key" is held down
}
// Example
if (Input.GetKey("left shift"))
{
RunBool = true;
WalkBool = false;
}
Example 2: how to check if key is held in unity
/*the other guys is right it is just*/
input.GetKey("Key") /*eg - Keycode.W/A/S/D*/