Simple AI Obstacle Avoidance in Unity @KetraGames
Simple AI Obstacle Avoidance in Unity  @KetraGames
Uploaded July 2024 | Updated September 2026, 2 weeks ago
In this Unity tutorial, we'll explore how to add some simple obstacle resolution logic to enemies, so they don’t get stuck walking into each other.

We’ll also look at how the same logic can be used to have the enemies navigate around obstacles.

To do this we'll make use of Unity's Physics2D.CircleCast method to detect obstacles and then take action to avoid them

This is the twentieth video in our series showing how to make a full top down 2D shooter game in Unity.

The playlist for this series can be found here
youtube.com/playlist?list=PLx7AKmQhxJFajrXez-0GJgDlKELabQQHT

The project files are available to our patrons here:
patreon.com/posts/107228431

Want to follow along? This project is a good starting point
patreon.com/posts/104708841

The full Top Down Shooter Project is available to our patrons here
patreon.com/posts/75231350

The final scripts can be found here
dotnetfiddle.net/hSzQHd

Help support our work:
► Patreon: patreon.com/ketragames

Follow us:
► Ketra Games: ketra-games.com
► Patreon: patreon.com/ketragames
► Twitter: twitter.com/ketragames
► Facebook: facebook.com/ketragames

Introduction - 0:00
Demonstrating the Problem - 00:31
Explaining Unity's Physics2D.CircleCast - 01:54
Implementing the Basic Obstacle Avoidance - 02:42
Improving the Obstacle Avoidance - 09:14
Testing Wall Avoidance - 14:19
Testing the Obstacle Avoidance in the Game - 15:54
Preview of the Next Unity Tutorial - 16:34

#KetraGames #LearnUnity #UnityTutorials #UnityTips
Simple AI Obstacle Avoidance in UnityCreating Simple Enemy AI to Chase the Player (Unity Tutorial | 2D Top Down Shooter)A Beginner Level Introduction to Prefabs (Unity Tutorial | 2D Top Down Shooter)Positioning Objects using Vertex Snapping (Unity Tip)Root Motion Explained (Unity Tutorial)Recentre the Camera on Key/Trigger Press Using Cinemachine (Unity Tutorial)Reuse Images at Different Sizes Using 9 Slicing (Unity Tutorial)How to Make the Camera Follow the Player Using Cinemachine (Unity Tutorial)Creating an Infinite Bouncing Ball with Physic Materials (Unity Tutorial)Setting the Value of a Property in the Inspector (Unity Tutorial)How to Procedurally Generate a Perfect Maze (Unity Tutorial)Shortcut to Maximise a View or Panel (Unity Tip)
Ketra Games |

Simple AI Obstacle Avoidance in Unity

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER