Creating The Boss Fight! (Part 2: The Shield Generator’s Setup & Movement)

As part of the Boss fight, the five Shield Generators will need to be destroyed first. Until they’re all destroyed, they will fully protect the Boss.

Today’s Objective: Create the code to spawn any number of Shield Generators I want, and have them rotate around the Boss’s main body.

First, I’ll create a new empty GameObject called “Boss”.

This will be the root object for all the Boss’s parts. I’ll create a placeholder child object with a Sprite Renderer component under this, just so that I can see the Boss for now.

I’ll also create another empty GameObject under the Boss called “Generator Rotator”, which will be the parent of all spawned Shield Generators.

Then I’ll create a new script called “BossShieldGenManager” and place it on the “Boss” GameObject:






The result:

Add a simple Trail Renderer component to make it even better!

In tomorrow’s post, Part 3, I will be working on the 2nd stage of the fight, the two Sentries (previously called the “Secondary Guns”).



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
Vincent Taylor

Vincent Taylor

Unity game developer / C# Programmer / Gamer. Australian (Tasmanian) indie games developer for 10+ years. Currently looking for games industry employment.