Making the Swooping Enemy
This is basically the normal Enemy with a few touchups.
- Drag on the Enemy Prefabs into the Hierarchy.
- Right-click it and go down to “Unpack Prefab Completely”.
- Rename it “Swooping_Enemy”.
- In the inspector, remove the Enemy script.
- Make a new C# script and name it “SwoopingEnemy”.
- Drag the new script into the Swooping_Enemy.
- Open the SwoopingEnemy and Enemy script.
- Copy everything from the Enemy to the SwoopingEnemy script.
- 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!