Search Unity

NavMesh -- Dashing Through Obstacles

Discussion in 'Navigation' started by The_Djinn, Sep 8, 2018.

  1. The_Djinn

    The_Djinn

    Joined:
    Jan 8, 2014
    Posts:
    3
    Hey there!

    I have NavMesh agent that I'd like to be able to dash through walls, similar to abilities like those found in League of Legends or DotA. As part of this, the unity needs to be able to identify the end point of the dash and, if not a valid position (due to terrain or another nav mesh agent) find the closest NavMesh point to end its movement on. The problem is that SamplePosition isn't limited to a single line, so when traveling through walls it can result in appearances at incorrect positions.

    Anyone have any recommendations to finding the closest point along a given line? I want to make sure that the non-navmesh movement of the dash ends up in a valid nav mesh location, and have been struggling with how to do this.