# Attach Region To Unit

Grammar — Attach region to unit with offset offset
FlagsNative | Action

Attaches a region to a unit.

# Arguments

  • region — Region
  • unit — Unit
  • point — Offset

Returns — void

native void RegionAttachToUnit(
	region r,
	unit u,
	point offset,
);

Category: Region / Modification

# Examples

campaigns/liberty.sc2campaignbase.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.sc2campaignbase.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.sc2mapMapScript.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.sc2mapMapScript.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.sc2campaignbase.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.sc2campaignbase.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.sc2campaignbase.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.sc2mapMapScript.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.sc2mapMapScript.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.sc2mapMapScript.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);