Jump to content

Pathfinding and ledges

Recommended Posts

I'm running into a problem with pathfinding where you have a ledge like this:


<- enemy


player |



The problem is that if the ledge is big enough, a path can't be created (which makes sense). However, GoToPoint still returns true (presumably because the point that the enemy is trying to go to is on an unconnected navmesh).


Anyway, all I need is for the enemy to be able to walk over the ledge. How would I recognize that the enemy reached the edge of the upper platform though?

Share this post

Link to post

The recognition is the easy part. I would use Pick from the tip of the feet to some distance directly below them. If the collision is far enough away from the foot (or if there's no collision) then the character is standing on a ledge.

Share this post

Link to post

Thanks! I actually saw those slides and a few others from Valve a few years back. I'm amazed at the number of picks that they perform with the number of zombies that they have and are still able to get good performance.


My AI has a similar thing going on (the parkour example in the Workshop uses a similar method) to get over edges.

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...