void Jump() { if (isGrounded) { rb.velocity = new Vector3(rb.velocity.x, 0, rb.velocity.z); rb.AddForce(transform.up * jumpForce, ForceMode.Impulse); } } code example
Example: void Jump() { if (isGrounded) { rb.velocity = new Vector3(rb.velocity.x, 0, rb.velocity.z); rb.AddForce(transform.up * jumpForce, ForceMode.Impulse); } }
void Jump()
{
if (isGrounded)
{
rb.velocity = new Vector3(rb.velocity.x, 0, rb.velocity.z);
rb.AddForce(transform.up * jumpForce, ForceMode.Impulse);
}
}