Patrolling Behavior Lecture: Add Gizmo Radius to WaypointTolerance

For the patrolling behavior lecture, consider adding the gizmo radius (sphere radius) to the way-point tolerance. This is because, depending on the navmesh design, the enemy is stopping some distance >1.0f when it moves to the first waypoint, which is currently the waypointTolerance. Therefore, the AtWaypoint() doesn’t seem to be getting triggered.

If this is not done, in my case, the enemy would get to the last waypoint, and stop, instead of looping around in the specified waypoint patten. The distance from the last waypoint would be like 1.07f … which would prevent AtWaypoint() from getting triggered because it’s hard coded to a value of 1.0 … in the enemy prefab.

Privacy & Terms