I know this is an old post I’m replying to, but maybe my reply will be helpful to others. I had the same issue described by Cdnalsi and discovered that my enemy lasers were immediately colliding with the enemy’s rigid body 2D component. Due to the interplay between the Enemy script and the DamageDealer script this means that the laser is immediately destroyed. Another factor, or so I suspect, is that my wave config patterns are primarily downward motion (this may be why Cdnalsi’s non-moving Roger shot lasers just fine).
My solution was to instantiate the laser just a bit lower than the enemy, thus getting it outside of the collider.
private void Fire() {
var laserTransform = transform.position;
laserTransform.y -= 1;
var enemyLaser = Instantiate(projectilePrefab, laserTransform, Quaternion.identity);
enemyLaser.GetComponent<Rigidbody2D>().velocity = new Vector2(0, -projectileSpeed);
projectiles.Add(enemyLaser);
}
At some point, I might create a solution whereby an enemy projectile doesn’t interact with an enemy.