private void MakeFireBall() //makes the fire ball { if (playerInventory.currentMagic > 0) //if player still got magic in the magic bar { Vector2 temp = new Vector2(animator.GetFloat("moveX"), animator.GetFloat("moveY")); //for the blend tree animation of the fireBall FireBall fireBall = Instantiate(projectile, transform.position, Quaternion.identity).GetComponent <FireBall>(); //makes a fireBall clone thats in the player position fireBall.Setup(temp, ChooseFireBallDirection()); //for moving the fire ball in reduceMagic.Raise(); //send signal to decrease magic player has } }