Find if NavMesh area is walkable but not accessible.

Unity3D 2016. 5. 19. 11:15
반응형

Find if NavMesh area is walkable but not accessible.

  1. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Messages:
    193
    Hi,
    I would like to know if my NavAgent is going on a not accessible NavMesh area (because there is no continuity of NavMesh) but it is walkable.

    [​IMG]

    Code (csharp):
    1.  
    2.     if(MouseClickOnWalkable && AreaIsAccessible){
    3.  
    4.     MyNavAgent.SetDestination(ThisTargetPosition);
    5.     ......
    6.  
    No problem for "MouseClickOnWalkable" bool but I need to know also "AreaIsAccessible" bool.


    Otherwise the character moves up to approach the target point. I wish that when I click on a not accessible area, it does not move.
    How you do?
     
    Last edited: May 18, 2015
  2. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Messages:
    193
    [​IMG]

    NavMesh.CalculatePath does not work.
    Even if the target point is located in a "detached area" of NavMesh, the result of CalculatePath is true!
    Why??
     
  3. bart_the_13th

    bart_the_13th

    Joined:
    Jan 16, 2012
    Messages:
    81
  4. RomanLed

    RomanLed

    Joined:
    Apr 25, 2014
    Messages:
    2
    //Check if path is continuous to destination
    if (agentNav.pathStatus == NavMeshPathStatus.PathPartial)
    {
    //etc...
    }


반응형
: