private void FixedUpdate() { if (canMove == true) { if ((dire.x > 0 || dire.x < 0) && Input.GetMouseButtonDown(1) && PS.currentStamina >= 12f) { rb.MovePosition(rb.position + move * Time.fixedDeltaTime * dashSpeed); PS.StaminaDecrease(); } else if ((dire.y > 0 || dire.y < 0) && Input.GetMouseButtonDown(1) && PS.currentStamina >= 12f) { rb.MovePosition(rb.position + move * Time.fixedDeltaTime * dashSpeed); PS.StaminaDecrease(); } else { rb.MovePosition(rb.position + move * Time.fixedDeltaTime); if (PS.currentStamina <= 100) { PS.StaminaIncrease(); } } } }