Enemies Disappear When They Fire

For some reason my enemy ships disappear when I fire in the “Make Eneny Shoot” lesson. I’m running Unity 2020.2.4f1. I’ve had a minor issue with getting enemies to appear in earlier lesson and solved that by changing the order in the default layer to a higher number. My player is 1, player laser is 2, enemies are 3, and enemy laser is 4.

Not sure why the enemy ships disappear. Even though they disappear when the laser fires, I’d expect them to reappear in the next frame. Any suggestions would be helpful. Thanks.

Hi kbierre,

Welcome to our community! :slight_smile:

What do you mean by “disappear”? Does the enemy also disappear in the Hierarchy? If so, it might be shooting itself, or it might have been spawned inside the shredder collider. Or they share the same z-position as the background.

If they shoot themselves, please keep watching. Rick solves that problem in lecture “Layer Collision Matrix”.


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms