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

Calculate Path Is Acting weird

Discussion in 'Navigation' started by ekoops, Jun 29, 2018.

  1. ekoops

    ekoops

    Joined:
    May 24, 2010
    Posts:
    74
    I am creating a system where i need to use the CalculatePath method for generating a road for my character. But i have some issues with it. It doesn't handle slopes that well. The code is very simple in this example.

    Vector3 startPos = new Vector3(0,0,0);
    Vector3 endPos = new Vector3(10,5,0);
    NavMeshPath path;
    NavMesh.CalculatePath(startPos, endPos, NavMesh.AllAreas, path);

    If you look at the image is the left image the one i want. But it calculate the path as the image to the right.
    Why does it do that and what can i do about it?



    Hope you can help me. Thanks.
     

    Attached Files: