CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Follow publication

Member-only story

Implementing a point-and-click navigation in Godot/C#

Let’s create a basic move AI for a little RTS-like game!

Mina Pêcheux
CodeX
Published in
19 min readJan 18, 2023

Although there are many types of games, some systems are common to many of them. Navigation is a good example of this globally shared logic: be it for a side-scroller roguelike with endless waves of skeletons coming to your hero, or a huge MMORPG with escort quests, or a strategy game with packs of units, you can think of plenty of situations where you’d want some object in your scene to move from one point to another while avoiding obstacles.

This is by no means easy to implement, and if you do it from scratch, you’ll need to take some time to understand the problem at hand, abstract it into a solvable representation, and apply some graph theory-related algorithms like the famous A* to compute paths for your units.

But, luckily, when using a game engine like Godot, most of this has already been taken care of for us ! :)

So, today, let’s explore how we can use Godot’s built-in navigation tools to have a little ship unit glide to a target location while avoiding all the hangars and rocks on the way…

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! 🚀

Demo of the final system

By the end of the tutorial, we will have this little scene with a ship we can control by right clicking on the ground to set its target position:

The path to the position will be computed with Godot’s 3.5+ navigation utilities.

Also, as usual, don’t forget that you can also get all the assets in the scene and the scripts we’ll make in the video in the Github repo with all my Godot tutorials 🚀

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

CodeX
CodeX

Published in CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Mina Pêcheux
Mina Pêcheux

Written by Mina Pêcheux

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

No responses yet

Write a response