Implementing a basic building placement system in Unity/C#

Wanna learn how to implement a building placement à-la RTS?

Mina Pêcheux
CodeX

--

Photo by Sean Pollock on Unsplash

I’ve always been a big fan of RTS games and, among other things, of how they let you to build your little town in a unique and personal way!

So, in this tutorial, we’re going to see how to make a basic free placement scheme à-la RTS, that allows us to click on a UI button to select a building to place, move around our map with our mouse to select a position and finally click to instantly place our building :)

We’ll even add some nice features like cancelling the build, allowing for chained builds or rotating the ‘phantom’ building to change the orientation of the placed building.

Note: If you’re curious about other RTS features, don’t hesitate to have a look at my RTS tutorial series available as an e-book, or articles on Medium! 🚀

This tutorial is available in video or text format — see below for the text version :)

--

--

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 :)