void CompleteLinkTraversal()

robot_2Generated
code_blocksInput

Description

The CompleteLinkTraversal method is used to finish the traversal of a link in the navigation mesh. This method must be called after the agent has traversed a link if the AutoTraverseLinks property is set to false. It ensures that the agent completes the link traversal process correctly.

Usage

To use the CompleteLinkTraversal method, ensure that your NavMeshAgent instance is currently traversing a link and that AutoTraverseLinks is set to false. Once the agent has completed the physical traversal of the link, call this method to finalize the traversal process.

Example

// Example of using CompleteLinkTraversal
NavMeshAgent agent = new NavMeshAgent();

// Assume the agent is traversing a link and AutoTraverseLinks is false
if (agent.IsTraversingLink)
{
    // Perform custom traversal logic here
    
    // Once traversal is complete, call CompleteLinkTraversal
    agent.CompleteLinkTraversal();
}