Function AgentOffMeshLinkTraversalContext.Abort

Abort (bool teleportToStart=true)

Aborts traversing the off-mesh link.

Public
void Abort (

bool

teleportToStart=true

If true, the agent will be teleported back to the start of the link (from the perspective of the agent). Its rotation will remain unchanged.

)

Aborts traversing the off-mesh link.

This will immediately stop your off-mesh link traversal coroutine.

This is useful if your agent was traversing an off-mesh link, but you have detected that it cannot continue. Maybe the ladder it was climbing was destroyed, or the bridge it was walking on collapsed.

Note

If you instead want to immediately make the agent move to the end of the link, you can call Teleport, and then use 'yield break;' from your coroutine.