2D Galaxy Shooter — New Enemy Type: Swooping Enemy

Hello all!

Today, I will go over how I made a new enemy type: The Swooping Enemy! They will come from the top edge of the screen, then go down at an angle while shooting every second.

This is basically the normal Enemy with a few touchups.

  1. Drag on the Enemy Prefabs into the Hierarchy.
  2. Right-click it and go down to “Unpack Prefab Completely”.
  3. Rename it “Swooping_Enemy”.
  4. In the inspector, remove the Enemy script.
  5. Make a new C# script and name it “SwoopingEnemy”.
  6. Drag the new script into the Swooping_Enemy.
  7. Open the SwoopingEnemy and Enemy script.
  8. Copy everything from the Enemy to the SwoopingEnemy script.
  9. Make a method:

10. Call SpawnDirection() in Start().

11. Modify CalculateMovement();

12. Modify IEnumerator FireEnemyLaserRoutine():

13. Add the new enemy to the SpawnManager.

14. Test it out! It should start at the top edge of your screen, then go down at an angle while shooting!

That has been how to make a new enemy that swoops down! Next, I will go over how to make an aggressive Enemy! Gotta keep your shields up for this!

Thank you for your time!

Hello all! I am starting Unity and learning the rope as I go!