Journal 141 — Unity Project Development, 2.5D Shooter

Objective: To update the enemy weapon

In the previous article, I added a wave system for enemies and got them moving on a waypoint system. In this article, I will add a basic enemy weapon to fire randomly.

Enemy Weapon

First, I will update the bullet projectile script so I can use it for the player projectiles and also the enemy. Both the enemy and player projectiles are destroyed after leaving the game area.

Then, I will add a new empty game object to the enemy prefab for where the enemy missiles can be instantiated, similar to how I set up the player. I will also add a function for the enemy missiles to instantiate and call the movement function in the Bullet script.

In the Enemy base script, I will get a reference to the WeaponFire script in order to instantiate the enemy missiles. I will use a timer to fire missiles randomly. Since I’m using a waypoint system to return the enemy fighters to the right side of the screen, I’m also restricting the missiles to only fire within the game screen.

Now, let’s check the results.

Thank you for your time!

The next article will be longer. I will go over several interrelated updates to add power ups to power up the player’s weapons, and also the hit triggers to destroy both an enemy and player, and also a restart option after the player is destroyed.

--

--

--

An Engineering Manager consultant who is seeking additional skills using Unity 3D for game and application development.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The next chapter

{UPDATE} Top Trucks Driving - Gratis Juego MMX de Carreras de Camiones para niños Hack Free…

Checking Python Version before Running a Script

Git Cherry Pick: All Developers Should Know

Markdown To Pdf With Pandoc And Miktex

A Year In The Making

Journal 147 — Unity Project Development, 2.5D Shooter

Software craftsmanship and embracing complexity

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chris Nielsen

Chris Nielsen

An Engineering Manager consultant who is seeking additional skills using Unity 3D for game and application development.

More from Medium

Journal 143 — Unity Project Development, 2.5D Shooter

A Series On Creating Immersive Audio in Unity with Custom Wwise Scripts

Editing FBX Files

Animating Zombies: Root Transforms