//Allows the player to shoot for 5 seconds IEnumerator BlastPowerUp() { playShot = true; while (playShot == true) { UIBlastIcon.SetActive(true); yield return(new WaitForSeconds(5f)); playShot = false; } }
// Update is called once per frame void Update() { Move(); anim.SetBool("Idle", Mathf.Abs(horizontal) < 0.1f); if (Input.GetButtonDown("Jump") && jumpCount < 2) { Jump(); } if (playShot == true) { if (Input.GetButtonDown("Blast")) { fireBlast(); } } if (playShot == false) { UIBlastIcon.SetActive(false); } }