void GroundMovement() { gliderGeo.SetActive(false); if (isGrounded) { playerStamina.GainStamina(staminaRate); } //Debug.Log("Stamina: " + playerStamina.stamina); if (isGrounded && velocity.y < 0) { velocity.y = -2f; } float x = Input.GetAxis("Horizontal"); float z = Input.GetAxis("Vertical"); Vector3 move = transform.right * x + transform.forward * z; controller.Move(move * speed * Time.deltaTime); if (Input.GetButtonDown("Jump") && isGrounded) { //Debug.Log("Jump"); velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity); } velocity.y += gravity * Time.deltaTime; controller.Move(velocity * Time.deltaTime); }