Spawning Waves of Enemies

Jared Amlin
6 min readOct 2, 2021

--

Are you ready to ride the waves? My objective for this article, is to create a wave spawning system that will drop more enemies as the waves progress. My solution here is fairly quick and easy to implement, so let’s get to it!

I begin by adding a new UI Text Mesh Pro game object to the UI Manager(Canvas), titling it Wave_Text, and anchoring it to the center of the screen.

Wave is typed as a placeholder string in my Text Input dialog box, a custom font asset is dragged into the Font Asset assignment slot, and the alignment is set to be centered on the horizontal and vertical axes.

Here is how the text is currently displaying.

The UI Manager class will need a few variables to work with the new wave text and update it accordingly. The TMP_Text variable is a reference to the wave text game object, and the currentWave variable will represent the current active wave of the game. I then set the waveText active to be false in void start, which disables the object until it’s needed.

Back in Unity with the UI Manager selected, the new wave text game object is assigned to it’s respective slot via drag and drop into the inspector.

I make two public methods in the UI Manager class, to be called by the Spawn Manager for text updates. The UpdateWaveText method requires a matching int value for currentWave to be passed through. The currentWave variable on the UI Manager is then assigned the value of the currentWave variable being…

--

--

Jared Amlin

I am an artist and musician, that is currently diving headfirst into game development with C# and Unity3D.