MoveToLocation call fails to project the location to the navmesh

Hi!

I have a MoveToLocation call that sometimes fails to project the location to the navmesh even though there are navmesh over the whole level.

If there are “too big” height differences between the location and the navmesh the call seems to fail to project the location to the navmesh.

The problem is that I only know where I want the pawns to go in the XY plane. The Z axis is there for cosmetic purposes only.

What’s the recommended way of solving this? I understand that one can raycasts against the landscape but is it really necessary to involve the collision system to get proper movement locations? Or can you somehow change the max distance MoveToLocation uses to project the location to the navmesh or is this just a bug?

The easiest and quickest way would be to modify NavigationSystem::SupportedAgents to extend DefaultQueryExtent, specifically its Z component. This extent is used in navigation queries, like finding start and end locations during pathfinding.

You can find these settings in Project Setting’s.

We have a fix coming in soon that will solve this problem for all character-based navigation, but that’s not in yet.

Cheers,

–mieszko

Okay, thanks a lot!

Do I need to somehow link these settings to the actual actors/agents or is it just an array of settings that must be supported in the navigation system? If not how would I do that?

SupportedAgents is meant to hold “types” of your agents, and any agent querying navigation at runtime is automatically assigned one of those types. Mind that currently for every supported agent a separate navmesh instance is being created.

Okay, I see. Thanks again!