AI walks to location below target instead of target

I’m encountering an issue with my AI pathfinding. Here’s an image illustrating the problem: image

Image:

  • The blue “X” in the image is the target location.
  • The blue line shows the intended path the AI should take.
  • The red line shows the actual path the AI chooses.

The AI turns around and starts heading to the location below the target about 1–2 meters before reaching the edge of the nav mesh at the bottom.

Here are some settings I’m currently using:

  • AI’s acceptable radius: 5.0
  • Nav walking search height scale: 0.5
  • Nav mesh step height: 220 (the character can climb)

The AI can climb if lured up an object or slope, so climbing isn’t broken or something.

Things I’ve Tried:

  • Moving the target location higher along the Z-axis
  • Changing the default query extent (low Z values will make the AI not walk at all, any low number where the AI walks, has the issue present)
  • Changing the nav walking search height scale

Unfortunately, none of these fixed the issue.
I’m probably missing something, but I can’t seem to fix this. Does anyone know what might be causing this?

I'm using Unreal Engine 4.27
I'm using a 'move to' behavior tree node (with acceptable radius set to 5.0)

UE4 ai-move-to ai-navigation AI Blueprint AI

Hey @PixelIndieDev! Thanks for the amazing explanation :star_struck:

I can’t replicate the issue. Looking at the image you provided, there seems to be no issue with the Nav Mesh, your AI character should be able to reach that target at the top. Also, since the path is on a ramp, the step height wouldn’t be a problem. And even if the AI character’s allowed walkable floor angle was insufficient for the ramp, it would still try to reach the goal but would be blocked by the steep ramp.

So here are some things to consider here:

  • Ensure that the target is projected onto the platform and not the ground. You can check it by casting a line trace from the target location to straight down to the ground and take a look at where it hits.
  • Ensure that there’re no obstructions on the path. From your image, we can’t clearly see if the whole path is covered with no interruptions.

Hope these can help :innocent:
Good luck on your further investigation!

I checked and the target location is on the platform and not the ground. If I manually move the AI to the ramp up part of the platform, the AI will move to the correct location. But from any other angle, the AI will not take the right path.

There are also no obstructions. The issue happens on multible parts of the map and in alll cases a clear path is possible for the AI to take.

Placing an obstacle nav modifier under the platform, will also not fix the issue.

I found the problem. The AI has issue due to the step height being 220.0. If I set it to a lower amount, the AI will move correctly again.

Now I just have to place nav links everywere so that the AI knows that he can climb up stuff :pensive:.

Interesting. I first thought you wrote that wrong and it was actually 22.0, but still tested it for 220.0 as well to make sure. I couldn’t replicate the issue for myself yesterday with the settings you specified.

Well, glad you got it working now :smiling_face_with_three_hearts:

5.5 has an auto nav link generation