MoveToLocation - shortest path

Hey, I am using MoveToLocation function (By AIController) to move the character from point to point.
When the target point is in unreachable position and character does not move. How can I tell the character to get closer as it can to the reach point?


When I click the house, the target point sets to the surface (Not the roof).
The Character can not reach the target point because it is inside the house. How can I tell the character to get closer as it can to the target point?

By default it should do what you need, provided it was possible to project destination location to navmesh. I bet in this case the clicked location is too far above navmesh and projection fails. You can modify the default projection extend via project settings, Navigation System -> Supported Agents.

However, this would be a short-sighted fix. The proper fix would be to detect what you actually clicked and send AI to that something’s location.

Cheers,

–mieszko