Making an RTS game #12: Moving character units (Unity/C#)

Let’s continue our RTS video game — we’ll talk about AIs and pathfinding!

Mina Pêcheux
CodeX

--

⬅️ Tutorial #11: Adding a day-and-night cycle| TOC | Tutorial #13: Adding a minimap and fog of war 1/3 ➡️

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

Today, we’re going to add a fundamental feature to our RTS game: the ability for our character units to move around in the scene! Whereas buildings are placed once and for all, characters can be selected and then moved by the player by targeting a specific destination point clicked on the ground. This will require us to use a pathfinding algorithm so our units can compute the best path to follow from their current to their target positions.

Here is a preview of what we’ll be able to do at the end of this tutorial: by selecting one or more units and right-clicking on the ground, we can give them a target point and they will walk on the terrain while avoiding obstacles! :)

--

--

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