Saturday, May 25, 2019

Visualizing Paths between Waypoints, Having Agent follow Path on Navmesh

I fixed an error in my code from last week. I changed "UIStart" on line 58 in "AIWaypointNetworkEditor" to "UIEnd," a simple fix. Now, when the "Display Mode" drop-down in the inspector is changed to "Paths," we can see a path drawn in yellow from the two selected way-points.




The agents now move from way-point to way-point, in order, beginning with way-point 0, then continuing down the chain. The ones that started away from way-point 0 move toward way-point 0. The local avoidance system is working, so that agents traveling along the same path do not collide with each other. The navmesh is used to calculate the optimal path from way-point to way-point.

Here is the new NavAgentExample script from this week, for getting the agent to follow paths between way-points via the navmesh:



Work on this will continue next week.

No comments:

Post a Comment