public float gravity = -9.81f;
public float jumpHeight = 3f;
void Update()
if(Input.GetButtonDown(“Jump”) && isGrounded)
{
velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity);
}
public float gravity = -9.81f;
public float jumpHeight = 3f;
void Update()
if(Input.GetButtonDown(“Jump”) && isGrounded)
{
velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity);
}
It seems like you watch the FPS Controller tutorial from Brackeys, you can watch it again to see if you’re missing something(I think that you didn’t include the line below, however, you should copy all the code you see in the video)
controller.Move(velocity * Time.deltaTime)