Making a RTS game #4: Selecting units (Unity/C#)

On with the coding of our RTS game! Today: the selection of units…

Mina Pêcheux
CodeX

--

⬅️ Interlude #1: Introducing an event system | TOC | Tutorial #5: Transforming our data into Scriptable Objects ➡️

📕 Get the ebook and bonus material on Gumroad!
🚀 Find the code of this tutorial series on my Github!

When you’re playing a strategy game, one of the key points is to be able to interact with the things on screen. Most notably, you want to be able to select the buildings and characters on the ground in order to give them orders or get additional info on their current state. This selection logic usually relies on two types of actions for the player: either drag a box around the things you want to select, or click on some of them more specifically.

So today, let’s see how to add this core feature to our RTS game! And just to give you an idea, here is a preview of the selection system we will have by the end of this tutorial:

Disclaimer: this episode of the series is very inspired by Jeff Zimmer’s tutorial on RTS-like selection in Unity 5. In

--

--

Mina Pêcheux
CodeX

I’m a freelance full-stack web & game developer. I’m passionate about topics like CGI, music, data science and more! Find me at: https://minapecheux.com :)