Provides information about the current link traversal for a NavMeshAgent
. This field is nullable, meaning it can hold a value or be null if the agent is not currently traversing a link.
Provides information about the current link traversal for a NavMeshAgent
. This field is nullable, meaning it can hold a value or be null if the agent is not currently traversing a link.
Use this field to access details about the link traversal when the NavMeshAgent
is navigating across a link. This can be useful for custom handling of link traversal events or for debugging purposes.
// Example of accessing CurrentLinkTraversal NavMeshAgent agent = new NavMeshAgent(); // Check if the agent is currently traversing a link if (agent.CurrentLinkTraversal.HasValue) { var linkData = agent.CurrentLinkTraversal.Value; // Use linkData to get information about the traversal // For example, you might log the start and end points of the link Vector3 startPoint = linkData.StartPosition; Vector3 endPoint = linkData.EndPosition; // Perform custom logic based on link traversal }