Search Unity

NavMeshPath doesn't generate "corners" on slopes

Discussion in 'Navigation' started by edwar496, May 7, 2018.

  1. edwar496

    edwar496

    Joined:
    Jun 28, 2016
    Posts:
    18
    Hey guys! I'm messing around with NavMesh, specifically trying to make an RTS or tactical style movement system where it draws a path from the character to the mouse's position along the path the character would take. It's working fairly well, except for slopes. I'm just doing the following:
    • Calculating a NavMeshPath to a certain point (in this case, raycasted from mouse)
    • Grabbing the list of "corners" on the NavMeshPath
    • Plugging the corners as points into a Line Renderer to see a visualization of the NavMeshPath
    Unfortunately, it seems NavMesh doesn't consider slopes to be "corners", so I don't have any way to round my path to contour them. The only way it would draw a corner on a slope is if my agent actually changes direction (like he does at the foot of the slope), but when the slope ends at the top, it doesn't consider this a corner, so the path just draws a straight line from the foot of the slope to the final destination (regardless of how far back I move the destination).

    Does anyone have any potential solutions or work-arounds for this? Really what would be ideal is something that adjusts the path to consider "slopes" to be "corners" as well, but I don't know if such a thing exists. Thanks!
     
  2. edwar496

    edwar496

    Joined:
    Jun 28, 2016
    Posts:
    18
    Bumping, still no solution :(