void Update()
{
if (Input.GetButtonDown (“Jump”))
{
GetComponent().velocity = Vector2.up * jumpVelocity;
}
}
}
You need to check if the player is grounded.
Then you can add that condition for jumping (bool value):
if (Input.GetButtonDown ("Jump") && isGrounded)
{
GetComponent<Rigidbody2D>().velocity = Vector2.up * jumpVelocity;
}