bool IsTraversingLink { get; set; }

robot_2Generated
code_blocksInput

Description

The IsTraversingLink property of the NavMeshAgent class indicates whether the agent is currently traversing a link. A link is a special connection between two points on a navigation mesh that the agent can traverse, often used for actions like jumping or climbing.

Usage

Use the IsTraversingLink property to check if the NavMeshAgent is in the process of moving across a link. This can be useful for triggering specific behaviors or animations when the agent is traversing a link.

Example

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

// Check if the agent is traversing a link
if (agent.IsTraversingLink)
{
    // Perform actions specific to link traversal
    // For example, play a climbing animation
    PlayClimbingAnimation();
}
else
{
    // Perform regular movement actions
    agent.MoveTo(targetPosition);
}