# Add Unit Group To Control Group

Grammar — Add unitGroup to control group controlGroup|Group Number for player player
FlagsNative | Action

Adds a unit group to a control group for a player.

# Arguments

  • int — Player
  • int — Control Group
  • unitgroup — Unit Group

Returns — void

native void UnitControlGroupAddUnits(
	int inPlayer,
	int inGroup,
	unitgroup inUnits,
);

Category: Selection / Control Groups

# Examples

mods/heroesdata.stormmodbase.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());