CODEX
Making a RTS game #2: Adding a very basic UI (Unity/C#)
Today, we continue our journey in programming a RTS (real-time strategy) game with Unity…
⬅️ Tutorial #1: Placing buildings️ | TOC | Tutorial #3: Setting up in-game resources ➡️
📕 Get the ebook and bonus material on Gumroad!
🚀 Find the code of this tutorial series on my Github!
In the first article of this series, I introduced the project and focused on implementing one of the core mechanics in any RTS game: placing buildings on the ground while checking for invalid placement, collisions, etc. We saw that, in a more advanced version of the game, we would probably want some sort of “building menu” that would list all possible building types, and that would let us click on a button to select the building we want to place.
So to start this UI off gently, we are going to create a very basic interface with the building menu containing one button per building type. Styling is going to be crude but it will implement all the required features to list the different types of buildings, pick the one we want to create and then link this to the building placement system we programmed in the previous tutorial.