if (Input.GetKey("space"))
{
Jump();
}
Of course, in the Jump function, check if their grounded. If they are, jump! Once their grounded again, allow them to jump again unless this is a jetpack where they continue to move upwards as they hold down space.
Hope this helps!
↧