Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Navmeshagent determine if unable to reach destination

Discussion in 'Navigation' started by Swisheh, Aug 2, 2020.

  1. Swisheh

    Swisheh

    Joined:
    Mar 28, 2017
    Posts:
    3
    So I have a bunch of enemies surrounding my player that carve out the navmesh when they stop to attack, but when the player is completely surrounded I want the enemies to determine that they can no longer reach the player and go for a different target. The enemies are currently just queuing up at the same spot. (Image attached) I'm trying to find a solution that detects if a target is unreachable.

    I have tried using pathStatus but it is always returning complete.
    I tried using a SamplePosition and it is always returning true.

    upload_2020-8-2_17-43-10.png
     
  2. Swisheh

    Swisheh

    Joined:
    Mar 28, 2017
    Posts:
    3
    Rewrote some code of mine this morning and found a somewhat fix using SamplePosition. It looks like there are some frames that return an available spot which causes them to turn back around for a split second, but I'll need to keep looking.

    upload_2020-8-3_14-1-22.png
     
  3. Swisheh

    Swisheh

    Joined:
    Mar 28, 2017
    Posts:
    3
    The problem I'm having now is the little holes that the SamplePosition would be detecting.. but the unit has no way of getting to it. If anyone has tips for this please let me know.

    upload_2020-8-3_15-45-19.png
     
unityunity