There's more...

We might need some special actions between transitions, such as animations. Imagine a one-directional link between a ledge and the ground. We have the power to know exactly when the agent hits the link, and then we can play an animation.

One way to do this is by deactivating the Auto Traverse Off-Mesh Links option on the NavMeshAgent component, playing the animation, executing the physics, and continuing with the logic as planned.

Get Unity 2018 Artificial Intelligence Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.