# Unit Can Path To Unit
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 unit.
# Arguments
unit
— Source Unitunit
— Targetfixed
— Rangefixed
— Max Distance
Returns — bool
native bool UnitPathableToUnit(
unit u,
unit 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
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/pulnar02.sc2map/MapScript.galaxy:1090
UnitGroupAdd(lv_attackTargets, gv_aRTANIS);
UnitGroupAdd(lv_attackTargets, gv_kERRIGAN);
if ((UnitPathableToUnit(lp_construct, gv_aRTANIS, 0.0, 1000.0) == false)) {
UnitGroupRemove(lv_attackTargets, gv_aRTANIS);
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/pulnar02.sc2map/MapScript.galaxy:1094
}
if ((UnitPathableToUnit(lp_construct, gv_kERRIGAN, 0.0, 1000.0) == false)) {
UnitGroupRemove(lv_attackTargets, gv_kERRIGAN);
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/pulnar02.sc2map/MapScript.galaxy:1141
UnitGroupAdd(lv_attackTargets, gv_aRTANIS);
UnitGroupAdd(lv_attackTargets, gv_kERRIGAN);
if ((UnitPathableToUnit(lp_crystal, gv_aRTANIS, 0.0, 1000.0) == false)) {
UnitGroupRemove(lv_attackTargets, gv_aRTANIS);
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/pulnar02.sc2map/MapScript.galaxy:1145
}
if ((UnitPathableToUnit(lp_crystal, gv_kERRIGAN, 0.0, 1000.0) == false)) {
UnitGroupRemove(lv_attackTargets, gv_kERRIGAN);
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/pulnar02.sc2map/MapScript.galaxy:1268
}
if ((UnitPathableToUnit(lp_enemyUnit, gv_kERRIGAN, 0.0, 1000.0) == true)) {
lv_kerriganValid = true;
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/pulnar02.sc2map/MapScript.galaxy:1274
lv_kerriganValid = false;
}
if ((UnitPathableToUnit(lp_enemyUnit, gv_aRTANIS, 0.0, 1000.0) == true)) {
lv_artanisValid = true;
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pulnar02.sc2map — MapScript.galaxy:1090
UnitGroupAdd(lv_attackTargets, gv_aRTANIS);
UnitGroupAdd(lv_attackTargets, gv_kERRIGAN);
if ((UnitPathableToUnit(lp_construct, gv_aRTANIS, 0.0, 1000.0) == false)) {
UnitGroupRemove(lv_attackTargets, gv_aRTANIS);
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pulnar02.sc2map — MapScript.galaxy:1094
}
if ((UnitPathableToUnit(lp_construct, gv_kERRIGAN, 0.0, 1000.0) == false)) {
UnitGroupRemove(lv_attackTargets, gv_kERRIGAN);
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pulnar02.sc2map — MapScript.galaxy:1141
UnitGroupAdd(lv_attackTargets, gv_aRTANIS);
UnitGroupAdd(lv_attackTargets, gv_kERRIGAN);
if ((UnitPathableToUnit(lp_crystal, gv_aRTANIS, 0.0, 1000.0) == false)) {
UnitGroupRemove(lv_attackTargets, gv_aRTANIS);
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pulnar02.sc2map — MapScript.galaxy:1145
}
if ((UnitPathableToUnit(lp_crystal, gv_kERRIGAN, 0.0, 1000.0) == false)) {
UnitGroupRemove(lv_attackTargets, gv_kERRIGAN);
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pulnar02.sc2map — MapScript.galaxy:1268
}
if ((UnitPathableToUnit(lp_enemyUnit, gv_kERRIGAN, 0.0, 1000.0) == true)) {
lv_kerriganValid = true;
}
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pulnar02.sc2map — MapScript.galaxy:1274
lv_kerriganValid = false;
}
if ((UnitPathableToUnit(lp_enemyUnit, gv_aRTANIS, 0.0, 1000.0) == true)) {
lv_artanisValid = true;
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:19917
lv_misha = libGDHL_gv_rexxarMishaUnit[lv_player];
if ((libGame_gv_players[lv_player].lv_activeVehicle == null)) {
if ((UnitPathableToUnit(lv_misha, lv_rexxar, 0.0, 0.0) == false)) {
UnitSetPosition(lv_misha, UnitGetPosition(lv_rexxar), false);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:19923
}
else {
if ((UnitPathableToUnit(lv_misha, lv_rexxar, 0.0, 0.0) == false)) {
UnitSetPosition(lv_misha, UnitGetPosition(lv_rexxar), false);
}
mods/novastoryassets.sc2mod — base2.sc2maps/maps/campaign/nova/nova04.sc2map/MapScript.galaxy:1046
autoC6E8BEE7_var = UnitGroupUnitFromEnd(autoC6E8BEE7_g, autoC6E8BEE7_u);
if (autoC6E8BEE7_var == null) { break; }
if ((UnitPathableToUnit(lp_sporeCrawler, autoC6E8BEE7_var, 0.0, 0.0) == false)) {
UnitGroupRemove(lv_nearValidUnits, autoC6E8BEE7_var);
}
mods/novastoryassets.sc2mod — base2.sc2maps/maps/campaign/nova/nova04.sc2map/MapScript.galaxy:1057
auto2CA30ED2_var = UnitGroupUnitFromEnd(auto2CA30ED2_g, auto2CA30ED2_u);
if (auto2CA30ED2_var == null) { break; }
if ((UnitPathableToUnit(lp_sporeCrawler, auto2CA30ED2_var, 0.0, 0.0) == false)) {
UnitGroupRemove(lv_farValidUnits, auto2CA30ED2_var);
}
mods/novastoryassets.sc2mod/base2.sc2maps/maps/campaign/nova/nova04.sc2map — MapScript.galaxy:1046
autoC6E8BEE7_var = UnitGroupUnitFromEnd(autoC6E8BEE7_g, autoC6E8BEE7_u);
if (autoC6E8BEE7_var == null) { break; }
if ((UnitPathableToUnit(lp_sporeCrawler, autoC6E8BEE7_var, 0.0, 0.0) == false)) {
UnitGroupRemove(lv_nearValidUnits, autoC6E8BEE7_var);
}
mods/novastoryassets.sc2mod/base2.sc2maps/maps/campaign/nova/nova04.sc2map — MapScript.galaxy:1057
auto2CA30ED2_var = UnitGroupUnitFromEnd(auto2CA30ED2_g, auto2CA30ED2_u);
if (auto2CA30ED2_var == null) { break; }
if ((UnitPathableToUnit(lp_sporeCrawler, auto2CA30ED2_var, 0.0, 0.0) == false)) {
UnitGroupRemove(lv_farValidUnits, auto2CA30ED2_var);
}