In Unity characters with Nav Mesh Agent component can navigate in the scene using pre-baked NavMesh
. There are cases when NavMesh
can have some discontinuities, for instance when we have a chasm or a cliff in the scene. In such cases, we can define the so-called Off Mesh Links to tell the character that he can jump over the chasm or drop from a cliff and continue navigation. In this recipe, we will use a character with a Nav Mesh Agent component and animate the off-mesh transitions using root motion.
We are going to use the same character as in the Using root motion to drive NavMesh Agents' movement with animations recipe with the Idle
, WalkLeft
, WalkForward
, and WalkRight
animations. Additionally, you should prepare a single JumpOffMesh
animation with forward root motion transition (starting and ending with an Idle
pose). We are going to use the NavMeshAgentWithRigidBody.cs
and ClickToMove.cs
scripts from the previously mentioned recipe to...