# Unit Can Path To Point
Grammar — unit Can Path To target with range Range and maxDistance Maximum Distance
Flags —Native
|Function
This returns whether or not the unit can path to the specified point.
# Arguments
unit
— Source Unitpoint
— Targetfixed
— Rangefixed
— Max Distance
Returns — bool
native bool UnitPathableToPoint(
unit u,
point inTarget,
fixed inRange,
fixed inMaxDistance,
);
# Related
Category: Unit / Basic
- Unit Show Kill Display —
void
— UnitShowKillDisplay - Unit Can Path To Point —
bool
— UnitPathableToPoint - Unit Can Path To Unit —
bool
— UnitPathableToUnit - Create Units With Default Facing —
void
— libNtve_gf_CreateUnitsWithDefaultFacing - Create Units With Point Facing —
void
— libNtve_gf_CreateUnitsAtPoint2 - Create Units Facing Angle —
unitgroup
— UnitCreate - Create Units Facing Point —
unitgroup
— libNtve_gf_UnitCreateFacingPoint - Last Created Unit —
unit
— UnitLastCreated - Last Created Units —
unitgroup
— UnitLastCreatedGroup - Original Caster Of Unit —
unit
— UnitGetOriginalCaster - Effect That Created Unit —
string
<gamelink::Effect> — UnitGetOriginalEffect - Replace Unit —
void
— libNtve_gf_ReplaceUnit - Last Replaced Unit —
unit
— libNtve_gf_LastReplacedUnit - Change Owner —
void
— UnitSetOwner - Unit Owner Changes —
void
— TriggerAddEventUnitChangeOwner - Old Unit Owner —
int
— EventUnitOwnerOld - New Unit Owner —
int
— EventUnitOwnerNew - Rescue Unit —
void
— libNtve_gf_RescueUnit - Rescue Unit Group —
void
— libNtve_gf_RescueUnit2 - Kill Unit —
void
— UnitKill - Revive Unit —
void
— UnitRevive - Remove Unit —
void
— UnitRemove - Owner Of Unit —
int
— UnitGetOwner - Unit Is Alive —
bool
— UnitIsAlive - Unit Is Valid —
bool
— UnitIsValid - Unit Group Is Dead —
bool
— libNtve_gf_UnitGroupIsDead - Move Unit Instantly —
void
— UnitSetPosition - Make Unit Face Angle —
void
— UnitSetFacing - Make Unit Face Point —
void
— libNtve_gf_MakeUnitFacePoint - Position Of Unit —
point
— UnitGetPosition - Goal Position Of Unit —
point
— UnitGetGoalPosition - Facing Angle Of Unit —
fixed
— UnitGetFacing - Pause/Unpause Unit —
void
— libNtve_gf_PauseUnit - Pause/Unpause All Units —
void
— UnitPauseAll - Sleep/WakeUp Unit —
void
— libNtve_gf_SleepUnit - Show/Hide Unit —
void
— libNtve_gf_ShowHideUnit - Share Vision of Unit —
void
— libNtve_gf_ShareVisionofUnit - Unit Is Paused —
bool
— libNtve_gf_UnitIsPaused - Unit Is Sleepiing —
bool
— libNtve_gf_UnitIsSleepiing - Unit Is Hidden —
bool
— libNtve_gf_UnitIsHidden - Unit Is Visible To Player —
bool
— libNtve_gf_UnitIsVisibleToPlayer - Set Unit Custom Value —
void
— UnitSetCustomValue - Custom Value Of Unit —
fixed
— UnitGetCustomValue - Unit Enters/Leaves Region —
void
— TriggerAddEventUnitRegion - Triggering Region —
region
— EventUnitRegion - Unit Enters/Leaves Point —
void
— TriggerAddEventUnitRangePoint - Unit Enters/Leaves Range Of Unit —
void
— TriggerAddEventUnitRange - Triggering Range Unit —
unit
— EventUnitRangeUnit - Unit In Region —
bool
— libNtve_gf_UnitInRegion - Triggering Unit —
unit
— EventUnit - Load Unit Model —
void
— UnitLoadModel - Unload Unit Model —
void
— UnitUnloadModel - Agent Of Player For Unit —
unit
— UnitAgent - Change Empty Unit Variables In Events —
void
— UnitEventSetNullVariableInvalid - Name of Unit —
text
— UnitGetName - Ideal Harvester Count —
int
— UnitIdealWorkerCount - Current Harvester Count —
int
— UnitCurrentWorkerCount
# Examples
mods/starcoop/starcoop.sc2mod — base.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.sc2mod — base.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);
}