# Unit Can Path To Point

Grammarunit Can Path To target with range Range and maxDistance Maximum Distance
FlagsNative | Function

This returns whether or not the unit can path to the specified point.

# Arguments

  • unit — Source Unit
  • point — Target
  • fixed — Range
  • fixed — Max Distance

Returns — bool

native bool UnitPathableToPoint(
	unit u,
	point inTarget,
	fixed inRange,
	fixed inMaxDistance,
);

Category: Unit / Basic

# Examples

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:1588

    UnitBehaviorRemove(UnitLastCreated(), "PowerUserBaseDefenseSmall", 1);
    UnitBehaviorRemove(UnitLastCreated(), "PowerUserQueue", 1);
    if ((lp_killingUnit != null) && (UnitGetPropertyFixed(lp_killingUnit, c_unitPropMovementSpeed, c_unitPropCurrent) != 0.0) && (UnitPathableToPoint(lp_killingUnit, PlayerStartLocation(1), 5.0, 100000.0) == false)) {
        UnitKill(lp_deadStructure);
    }

mods/warcoop/legends/gromhellscream.sc2modbase.sc2data/LibLGrm.galaxy:47

    for ( ; ( (auto52194A69_ai >= 0 && lv_currentdistance <= auto52194A69_ae) || (auto52194A69_ai < 0 && lv_currentdistance >= auto52194A69_ae) ) ; lv_currentdistance += auto52194A69_ai ) {
        lv_currentpoint = PointWithOffsetPolar(lv_startingpoint, lv_currentdistance, lv_anglebetweenstartandtarget);
        if ((PathingType(lv_currentpoint) == c_pathingGround) && (AbsF((lv_startingclifflevel - PointPathingCliffLevel(lv_currentpoint))) < lv_maxcliffdifference) && (UnitPathableToPoint(lp_pathingUnit, lv_currentpoint, 0.0, 500.0) == true)) {
            return PointWithOffsetPolar(lv_startingpoint, lv_currentdistance, lv_anglebetweenstartandtarget);
        }