Setup AI pathfinding

I’m making a 2D sidescroller where I want an AI enemy to chase after my character at all times. I’ve used the basic AI before where you can make the AI chase and kill you, but when the terrain gets complicated the AI can’t follow me, like for example having a platform you have to jump onto. Anyone know of any tutorials where I can learn how to setup pathfinding so my AI can follownme anywhere my player can go? This is probably a very complicated question but any help wi be appreciated.


Hey vrex119. You may already have seen this but a starting point would be the documentation on Nav Links.

EDIT - Ah, just reread the OP and realised that you’re using a 2D sidescroller. I’m not sure how NavMesh operates in 2D, so the above link may not be useful. Sorry! :slight_smile:

In UDK, I used triggers that, if touched by a vertical object, tells the AI to jump. I used two, one at the waist, and one above the pawn’s head.
The idea was that if both waist and head triggers were touched, then that means the wall is too high and there is no point in jumping it.

You can use either triggers or collision components, capture the angle of the obstruction (vertical wall), then tell the AI to jump.

This is off the top of my head.

There is also the Nav Mesh Proxy. I find it kind of too manual.

NavLinks are probably what will work best for you. This example and tutorial is for a side scroller.