public void FireArrows() { Quaternion arrowRotation = new Quaternion(); if (facingRight) { arrowRotation.eulerAngles = new Vector3(0, 0, 0); } else { arrowRotation.eulerAngles = new Vector3(0, 180, 0); } GameObject arrowPre = Instantiate(arrow, new Vector3(arrowSpawn.position.x, arrowSpawn.position.y - 1.5f, -5), arrowRotation); ProjectileScript projectileScript = arrowPre.GetComponent <ProjectileScript>(); projectileScript.setDirection(!facingRight); }