public void Shoot() { GameObject fireballGO = (GameObject)Instantiate(fireballPrefab, ProjectileSpawn.position, ProjectileSpawn.rotation); Fireball fireball = fireballGO.GetComponent <Fireball>(); ProjectileSpawn.LookAt(playerPos); FindObjectOfType <AudioManager>().Play("fireball"); fireball.Direction = ProjectileSpawn.forward; if (fireball != null) { fireball.Seek(target); } //Fireball fireballInstance = (Fireball)Instantiate(fireball, ProjectileSpawn.position, ProjectileSpawn.rotation); }