xxxxxxxxxx
Update is called -> GetKeyDown is true (this frame only) -> isJumpPressed = true
Update is called -> GetKeyDown is false -> isJumpPressed = false
FixedUpdate is called -> isJumpPressed is false
xxxxxxxxxx
//Triggers if Space is pressed
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
//Your code
}
}
xxxxxxxxxx
// Arrow Keys
Input.GetKeyDown(KeyCode.UpArrow) // can be True or False
// Specific Letter e.g. "A"
Input.GetKeyDown(KeyCode.A) // can be True or False
// Space
Input.GetKeyDown(KeyCode.Space) // can be True or False