Exact path of a NavMeshAgent

So I’m trying to show the path of how a NavMeshAgent will move, accounting for momentum and angular velocity. I’m currently using LineRenderer to draw the calculated NavMeshPath, but since I’m only accessing NavMeshPath.corners I’m just drawing straight lines between corner points and not the fully accurate paths, i.e. not displaying the extra distance an object will take to round a corner at high speed.

Are there any ways to display the actual, curved path the agent will take?

Thanks!

As far as I know, there aren’t any perfect solutions.
If your surface changes in height, the lines will likely go through some parts of it and float above others, as only actual direction changes create a corner. If you have agent avoidance, that’ll also modify the real path; I think this is the biggest issue.

I only see two approaches: either predict the real path, at this point you might as well be using a custom agent; or if you have some time beforehand you could pre-calculate the path with a ghost agent, and store its actual movement path.

1 Like