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

AI not using NavMeshLink?

Discussion in 'Navigation' started by Juice-Tin, Feb 13, 2022.

  1. Juice-Tin

    Juice-Tin

    Joined:
    Jul 22, 2012
    Posts:
    242
    Hello, I have a 2D platformer with a number of NavMeshLinks placed around.



    In Unreal Engine 4 it works perfectly. The AI attempts to move to the correct NavMeshLink, it then triggers a listener call on that link so I can run code to make it jump.

    However in Unity, they just attempt to move directly to the next platform without interacting with the link at all.
    I've had to write some very sloppy code where it scans all the link points and checks if it's close to the AI, and if the end point is in the direction the AI is heading, etc. It's very sloppy and doesn't perform well.

    Is there a proper way the AI should be interacting with these links that I'm not aware of?

    Thanks!
     
  2. You can find the proper handling here.
     
  3. Juice-Tin

    Juice-Tin

    Joined:
    Jul 22, 2012
    Posts:
    242
    This is for traversing the link using their built in movement.

    My game uses it's own custom movement system with physics and such. So their NavMeshAgent doesn't do anything when placed on my characters.

    So my question is when Unity creates the travel path, is there some way to get which NavMeshLinks it uses for those paths? Atm it just maps out points to run but ignores which links to take.
     
    Last edited: Feb 16, 2022