Member-only story
đźš© Creating a waypoints system in Godot/C#
Let’s setup a basic patrolling logic in Godot!
This tutorial is available in video or text format — see below for the text version :)
Check out the Github repo with all my Godot tutorials! 🚀
When you think about it, there are lots of situations in games where you might want one of your object to move according to a specific pattern — a moving platform, an enemy guard patrolling, RTS troups controlling…
This idea of describing a path with some waypoints and then automating the movement of a character or a doodad on the circuit is quite simple, but also very useful!

And, in Godot, setting up a basic looping path like this is actually really easy — so today we’re going to see how we can setup a patrol routine using Godot and C#, in just a few minutes! We will then improve it slightly to let our avatar mark a little pause when it reaches each waypoint, before continuing on its way.

🔍 An overview of the project
For this project, I have prepared a few assets before hand:
- To begin with, I made a basic Character scene, with a body and head to indicate its current rotation, and the red material that is applied on both meshes.

- Then, I created a main scene for this waypoints tutorial with an orthographic camera, a global directional light and a ground plane displaying a simple grid, and I instantiated my Character in here.