# Copy Unit Control Groups
Grammar — Copy the control group states of sourceUnit to targetUnit
Flags —Action
Copy all control group states on a unit to another unit.
# Arguments
unit
— Source Unitunit
— Target Unit
Returns — void
void libNtve_gf_CopyUnitControlGroups(
unit lp_sourceUnit,
unit lp_targetUnit,
);
# 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/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:26485
if (auto8B4AE5B8_var == null) { break; }
libNtve_gf_ReplaceUnit(auto8B4AE5B8_var, "TychusResearchCenterUnlocked", libNtve_ge_ReplaceUnitOptions_OldUnitsRelative);
libNtve_gf_CopyUnitControlGroups(auto8B4AE5B8_var, libNtve_gf_LastReplacedUnit());
UnitCreateEffectUnit(auto8B4AE5B8_var, "TychusResearchCenterCopyRally", libNtve_gf_LastReplacedUnit());
libCOUI_gv_cU_TychusSquadBar = libNtve_gf_LastReplacedUnit();