Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

NavMeshAgent isnt very eficcient about getting a proper steeringPosition from path.corners

Discussion in 'Navigation' started by diegodorado, Jun 22, 2015.

  1. diegodorado

    diegodorado

    Joined:
    Jul 2, 2013
    Posts:
    4
    Let me picture my problem so it can be understood correctly:

    I have a simple enemy script that set the mavmeshAgent.destination to a point in the worldspace ( that would be at top right corner in the pictures)

    I some strange ocassions, the navMashAgent pass through a waypoint (say, in a curve) and, instead of changing the steeringPosition to a more suitable one, it gets stuck with the previous one and starts to move backwards (!?).
    That isnt a very smart decission for pathfinding to me... why isnt it updating the path to continue advancing towards the target destination?

    In the images below, that little yellow square is the enemy, that magenta circle is the steeringPosition, and the red lines are the calculated path.
    Normally, the magenta circle updates to the next path.corner as it advances, (even if the enemy does not reach the magenta position).. but sometimes it gets stuck with it and stops, drives backwards, pass through the magenta circle, and then continues its way.









    Anybody having the same behaviour?
    Thanks in advance.
     
  2. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    you'll have to manage your own steering behavior if you want it to work smarter.