# Add Unit Group To Control Group
Grammar — Add unitGroup to control group controlGroup|Group Number for player player
Flags —Native
|Action
Adds a unit group to a control group for a player.
# Arguments
int
— Playerint
— Control Groupunitgroup
— Unit Group
Returns — void
native void UnitControlGroupAddUnits(
int inPlayer,
int inGroup,
unitgroup inUnits,
);
# Related
Category: Selection / Control Groups
- Control Group Units —
unitgroup
— UnitControlGroup - Copy Unit Control Groups —
void
— libNtve_gf_CopyUnitControlGroups - Add Unit To Control Group —
void
— UnitControlGroupAddUnit - Add Unit Group To Control Group —
void
— UnitControlGroupAddUnits - Remove Unit From Control Group —
void
— UnitControlGroupRemoveUnit - Remove Unit Group From Control Group —
void
— UnitControlGroupRemoveUnits - Clear Control Group —
void
— UnitControlGroupClear
# Examples
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:13062
AIAddPlayerUnit(UnitLastCreated());
UnitControlGroupAddUnit(lv_lVPlayer, 3, UnitLastCreated());
UnitControlGroupAddUnits(lv_lVPlayer, 4, libGame_gv_players[lv_lVPlayer].lv_heroUnitGroup);
UnitControlGroupRemoveUnit(lv_lVPlayer, 4, libGame_gv_players[lv_lVPlayer].lv_heroUnit);
PathCreateForUnit(libCore_gv_playerGroupFromPlayer[lv_lVPlayer], UnitLastCreated());