Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Determine links used in path?

Discussion in 'Navigation' started by jwvanderbeck, Feb 22, 2019.

  1. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    I need to adjust character state and animation state when a character traverses a NavMeshLink, whether that be jumping or some other things. How can I determine that an agent is using a link?
     
  2. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    To clarify here I am looking to use the newer Component based NavMeshLink if possible.
     
  3. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    Okay, first you'll need to disable autoTraverseNavMeshOfflink on your agents.
    Then, you can check isOnOffMeshLink and currenOffMeshLinkData to check if your agent is using a link, and then set your animations and movements manually.
     
  4. JohnVandebeck_MPCFilm

    JohnVandebeck_MPCFilm

    Joined:
    Jan 28, 2019
    Posts:
    2
    This works with the newer NavMeshLink though?
     
  5. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    I can't tell for certain, but considering the Agent can use the newer links at all I'm assuming it does.