Search Unity

Centralizing waipoints on a road with Nav Mesh.

Discussion in 'Navigation' started by Sharpin, Jul 12, 2019.

  1. Sharpin

    Sharpin

    Joined:
    May 26, 2019
    Posts:
    10
    Hi all.

    I have a road with nav mesh on which player can make waypoints for character. I'm trying to make something like map with waypoints and drawn path to it. Player can create waypoint on the road and line renderer draws the path. The problem is that i don't know how to set every created waypoint in the middle of the road, so it would look smooth and nice. Any ideas :) ?
     
  2. ShaneP1

    ShaneP1

    Joined:
    Aug 23, 2018
    Posts:
    5
    I also have similar question

    Regards,
    Shane
     
    Last edited: Aug 1, 2019
  3. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    Unfortunately Unity's navmesh system will automatically place points to make turns as short as possible, resulting in the waypoints being off-center. There is no way to disable this, the whole NavMesh system is very blackbox-like. Perhaps you could write your own Pathfinding system based on splines, if you've built your roads with those.