Search Unity

samplePathPosition always return false?

Discussion in 'Navigation' started by beatdesign, Jun 12, 2020.

  1. beatdesign

    beatdesign

    Joined:
    Apr 3, 2015
    Posts:
    137
    Hi, if I use samplePathPosition, it always return false. According to the docs, should return "True if terminated before reaching the position at maxDistance, false otherwise."
    Example:
    • I use this to search for RED areas
    • The path that my Agent is going to travel is a straight line. It goes through BLUE area (4 units), then RED AREA (4 units), then again BLUE area (4units), then stops.
    • I'm searching for RED Area using SamplePosition(RED_area_mask, 6, out hitInfo). This should search for RED area at a maximum distance of 6 units along my Agents path: since the RED area starts as soon as the BLUE area in front of him stops (after 4 units), it should return TRUE with a distance of 4 units.
    • Instead, during the travel, it returns always FALSE, and when hitInfo.mask will contain RED_area_mask, the distance returned is always 6 (the max distance)
    Is this a bug?
     
  2. beatdesign

    beatdesign

    Joined:
    Apr 3, 2015
    Posts:
    137
    Anyone?
     
  3. beatdesign

    beatdesign

    Joined:
    Apr 3, 2015
    Posts:
    137
    Bump!
    Is out here someone that uses samplePathPosition and can explain if this method is bugged or not?