Creating a Boss Weapon in Unity

Boss attack for phase 1

Rusben Guzman
2 min readSep 10, 2021

Objective: create a unique weapon for the enemy boss.

In order to create the enemy attack I created 2 variables and empty objects to get the positions of the cannons.

Then I created a new prefab. This one is an empty object that contains 3 enemy lasers in different angles. In this case the boss attack is a triple enemy shot.

In the boss script I created a game object variable to store the boss weapon prefab reference, another variable for the shoot delay and a coroutine variable to have the reference to the boss attack coroutine.

Last step was to create a coroutine to make the boss shoot the lasers. Is as simple as instantiating a boss laser in one cannon, then wait the delay time, then instantiate the boss laser in the other cannon and wait the delay time again.

And that’s it!!! We have the enemy attack for phase one ready.

--

--

Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.