AI Move To sudden stop when character jumps

I’m using an AI move to node to guide enemies towards my player, however I notice that whenever I jump a certain height the AI will suddenly stop moving. This happens when an actor is given as the target. However if I use actor location, it doesn’t. I prefer to use the former as it’s a much smoother turn/transition in real time than when simply using a location. What could be causing this behavior?

It could be that once the player character is at a certain height above the nav mesh, the AI is not able to project your location on to the nav mesh. Have you tried reducing the jump height? I’m not sure about this, but I think the default Z extent for nav mesh query is 250 units. So setting the jump height to something much lower might confirm if that is indeed the problem.

The characters max jump height is still within the bounds of the nav mesh. Would there be a way to change the max z extent?

There is this old UE4 livestream with Mieszko, where he talked about nav mesh settings:

In it, he mentions that if you have tall characters in your game that are having issues with the nav mesh pathing, you can add a new “Supported Agents” under Project Settings >> Navigation System, and increasing the z value of “Default Query Extent” for the new agent. That might be worth a try.

Edit: Also to make sure that its a nav mesh problem, you can also print the output of the “Project Point to Navigation” using your actor’s location.

If it returns False, then its the query extent being limited that’s causing the problem. By increasing the z value of the Query Extent parameter in the node, you will see at what point the return value will turn True.

4 Likes

Thanks, increasing the z value of Query Extent seemed to solve it.

Edit: It solves the issue, but not I have quite an FPS drop when adjusting it to where I need. =/

Edit 2: Even stranger, the FPS drop only occurs when using PIE. In standalone game it’s smooth at 120. =O

Well, in that case, does your AI move when you set Accept Partial Path to Yes in the AI’s Move to Location or Actor node? If it will, maybe query extent need not be increased.

Edit: Ok, I tried it out. That probably won’t work.

The performance is stable when playing standalone, so I’ll keep it with the increased z value for the time being. Thanks again for your assistance, it’s much appreciated! =)

For some reason i cant find “Default Query Extent” in the Navigation system did they change the name of it? am having the same problem!

Which engine version are you using? I was able to find it under that name in 4.21

It’s available in 4.24 as well. In case you missed it, you’ll have to add a new entry to “Supported Agents” for it to be visible.

Thanks alot that helped

1 Like