How it works...

The key to this recipe is the anim.MatchTarget() function. It smoothly stretches the animation's root motion to match the given position and rotation. With the agent.isOnOffMeshLink flag, we check every frame if our character is trying to traverse an off mesh link. If so, we simply play our JumpOffMesh animation and use the anim.MatchTarget() function to match the end position of our off mesh link. This works only if the Auto Traverse Off Mesh Links option is disabled in the Nav Mesh Agent Component. After we finish playing our animation, we call the agent.CompleteOffMeshLink() function to tell the Nav Mesh Agent component that it can continue path finding.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.212.102