void Update() { if (Input.GetKeyDown(KeyCode.X) && laser.currentEnergy > 24) { parry(); laser.TakeParryEnergy(); parryActive = true; lastParry = Time.time; } else { parryActive = false; } if (parryActive && Time.time - lastParry < parryTime) { sphereMesh.enabled = true; circleCollider.enabled = true; parryActive = true; } else if (Time.time - lastParry > parryTime) { sphereMesh.enabled = false; circleCollider.enabled = false; damageScript.NotParried(); } }