- Home /
Navmesh pathfinding "scattering"?
Hi. As far as I understand, NavMeshAgent finds the shortest way to get to destination. Is there a way to make it sometimes follow the path not perfectly?
What i'm trying to achieve is object that will fly to destination, but I need it sort of floating, not perfect A>B movement.
Thanks in advance.
Answer by tanoshimi · Sep 08, 2014 at 06:56 PM
Once you've called CalculatePath method of the NavMeshAgent, you'll get a NavMeshPath object representing the shortest route to the chosen destination. This object contains the set of waypoints along the route in the "corners" property. So, you should be able to manually iterate through that array and add some random noise to each waypoint before telling the NavMeshAgent to follow the path.
Your answer
Follow this Question
Related Questions
Player falling through navmesh? 0 Answers
How does NavMeshAgent.SamplePathPosition work? 1 Answer
How to find if a point can react another point without hitting a collider 0 Answers
Randomize NavMeshAgents path finding with same destination 1 Answer
is it possible to use navmesh on flying character and target ? 0 Answers