Making a RTS game #25: Implementing behaviour trees for our units 3/3 (Unity/C#)

Today, let’s finish implementing the AI for our units using behaviour trees!

Mina Pêcheux
C# Programming

--

⬅️ Tutorial #24: Implementing behaviour trees for our units 2/3| TOC | Tutorial #26: Levelling up our units! 1/2 ➡️

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

This past couple of weeks, we saw how to use behaviour trees (BTs) to model our units AI system in Unity using virtual and abstract classes, inheritance and polymorphism. We also prepared a toolbox of BT utilities and used them to rewrite our current building/character unit behaviour as BTs.

Today, we’re going to wrap this up by adding new abilities to our units: we want them to spot close enemies, optionally follow them and then attack if they’re within range.

Here’s a little demo of what we’re going to achieve in this tutorial!

Quick recap: what should our units be able to do?

--

--

Mina Pêcheux
C# Programming

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