# Attach Region To Unit
Grammar — Attach region to unit with offset offset
Flags —Native
|Action
Attaches a region to a unit.
# Arguments
region
— Regionunit
— Unitpoint
— Offset
Returns — void
native void RegionAttachToUnit(
region r,
unit u,
point offset,
);
# Related
Category: Region / Modification
- Random Point In Region —
point
— RegionRandomPoint - Center Of Region —
point
— RegionGetCenter - Unit Attached To Region —
unit
— RegionGetAttachUnit - Attach Region To Unit —
void
— RegionAttachToUnit - Move Region —
void
— RegionSetCenter - Width Of Region —
fixed
— libNtve_gf_WidthOfRegion - Height Of Region —
fixed
— libNtve_gf_HeightOfRegion - Bottom-Left Of Region Bounds —
point
— RegionGetBoundsMin - Top-Right Of Region Bounds —
point
— RegionGetBoundsMax
# Examples
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tvalerian02a.sc2map/MapScript.galaxy:6411
SoundPlay(SoundLink("Ultralisk_Ready", 0), PlayerGroupAll(), 300.0, 0.0);
CameraShakeStart(gv_p1_USER, c_cameraPositionTarget, c_cameraDirectionZ, 0.125, 2.5, 100.0, 3.0);
RegionAttachToUnit(RegionFromId(106), gv_tHEONEOMEGALISK, Point(0.0, 0.0));
Wait(2.6, c_timeGame);
UnitIssueOrder(gv_tHEONEOMEGALISK, OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(1889)), c_orderQueueReplace);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tvalerian03.sc2map/MapScript.galaxy:464
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropLifePercent, 100.0);
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0);
RegionAttachToUnit(RegionFromId(28), gv_leviathan, Point(0.0, 0.0));
}
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tvalerian02a.sc2map — MapScript.galaxy:6411
SoundPlay(SoundLink("Ultralisk_Ready", 0), PlayerGroupAll(), 300.0, 0.0);
CameraShakeStart(gv_p1_USER, c_cameraPositionTarget, c_cameraDirectionZ, 0.125, 2.5, 100.0, 3.0);
RegionAttachToUnit(RegionFromId(106), gv_tHEONEOMEGALISK, Point(0.0, 0.0));
Wait(2.6, c_timeGame);
UnitIssueOrder(gv_tHEONEOMEGALISK, OrderTargetingUnit(AbilityCommand("attack", 0), UnitFromId(1889)), c_orderQueueReplace);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tvalerian03.sc2map — MapScript.galaxy:464
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropLifePercent, 100.0);
UnitSetPropertyFixed(UnitLastCreated(), c_unitPropEnergyPercent, 100.0);
RegionAttachToUnit(RegionFromId(28), gv_leviathan, Point(0.0, 0.0));
}
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/ppurifier01.sc2map/MapScript.galaxy:1322
gv_displacementBeam.lv_shakeRegionLarge = RegionFromId(10);
gv_displacementBeam.lv_shakeRegionSmall = RegionFromId(24);
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionLarge, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionSmall, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(RegionFromId(65), gv_displacementBeam.lv_unit, Point(0.0, 0.0));
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/ppurifier01.sc2map/MapScript.galaxy:1323
gv_displacementBeam.lv_shakeRegionSmall = RegionFromId(24);
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionLarge, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionSmall, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(RegionFromId(65), gv_displacementBeam.lv_unit, Point(0.0, 0.0));
TriggerExecute(gt_DisplacementBeamScreenShake, true, false);
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/ppurifier01.sc2map/MapScript.galaxy:1324
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionLarge, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionSmall, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(RegionFromId(65), gv_displacementBeam.lv_unit, Point(0.0, 0.0));
TriggerExecute(gt_DisplacementBeamScreenShake, true, false);
Wait(10.0, c_timeAI);
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/ppurifier01.sc2map — MapScript.galaxy:1322
gv_displacementBeam.lv_shakeRegionLarge = RegionFromId(10);
gv_displacementBeam.lv_shakeRegionSmall = RegionFromId(24);
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionLarge, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionSmall, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(RegionFromId(65), gv_displacementBeam.lv_unit, Point(0.0, 0.0));
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/ppurifier01.sc2map — MapScript.galaxy:1323
gv_displacementBeam.lv_shakeRegionSmall = RegionFromId(24);
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionLarge, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionSmall, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(RegionFromId(65), gv_displacementBeam.lv_unit, Point(0.0, 0.0));
TriggerExecute(gt_DisplacementBeamScreenShake, true, false);
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/ppurifier01.sc2map — MapScript.galaxy:1324
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionLarge, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(gv_displacementBeam.lv_shakeRegionSmall, gv_displacementBeam.lv_unit, Point(0.0, 0.0));
RegionAttachToUnit(RegionFromId(65), gv_displacementBeam.lv_unit, Point(0.0, 0.0));
TriggerExecute(gt_DisplacementBeamScreenShake, true, false);
Wait(10.0, c_timeAI);