ProjectileScript InstantiateEnemyProjectile(int dir) { ProjectileScript newProjectile = Instantiate(enemyProjectilePrefab, new Vector3(transform.position.x + dir, transform.position.y), Quaternion.identity).GetComponent <ProjectileScript>(); newProjectile.setDiretction(dir); return(newProjectile); }