# Unit Is Clicked

Grammarunit is clicked by Player player
FlagsNative | Event

This event fires when a unit is clicked by a player. Use “Triggering Unit” to refer to the unit being clicked. Use “Triggering Player” to get the player.

# Arguments

  • unitref<unit> — Unit
  • int — Player

Returns — void

native void TriggerAddEventUnitClick(
	trigger t,
	unitref u,
	int player,
);

# Event parameters

Category: [Selection / Clicks and Highlights](/galaxy/reference#selection-clicks and-highlights)

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/traynor03.sc2map/MapScript.galaxy:1548

    gt_TaurenOuthouseLaunch = TriggerCreate("gt_TaurenOuthouseLaunch_Func");
    TriggerEnable(gt_TaurenOuthouseLaunch, false);
    TriggerAddEventUnitClick(gt_TaurenOuthouseLaunch, UnitRefFromUnit(UnitFromId(1167)), c_playerAny);
}

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:14890

void gt_PinboardItemClicked_Init () {
    gt_PinboardItemClicked = TriggerCreate("gt_PinboardItemClicked_Func");
    TriggerAddEventUnitClick(gt_PinboardItemClicked, null, c_playerAny);
}

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:19230

    gt_DebugClick = TriggerCreate("gt_DebugClick_Func");
    TriggerEnable(gt_DebugClick, false);
    TriggerAddEventUnitClick(gt_DebugClick, null, c_playerAny);
}

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:21921

void gt_HotspotClicked_Init () {
    gt_HotspotClicked = TriggerCreate("gt_HotspotClicked_Func");
    TriggerAddEventUnitClick(gt_HotspotClicked, null, c_playerAny);
}

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25611

void gt_ArmoryKachinskiClicked_Init () {
    gt_ArmoryKachinskiClicked = TriggerCreate("gt_ArmoryKachinskiClicked_Func");
    TriggerAddEventUnitClick(gt_ArmoryKachinskiClicked, null, c_playerAny);
}

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25655

void gt_ArmoryEarlClicked_Init () {
    gt_ArmoryEarlClicked = TriggerCreate("gt_ArmoryEarlClicked_Func");
    TriggerAddEventUnitClick(gt_ArmoryEarlClicked, null, c_playerAny);
}

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25701

void gt_BridgeBralikClicked_Init () {
    gt_BridgeBralikClicked = TriggerCreate("gt_BridgeBralikClicked_Func");
    TriggerAddEventUnitClick(gt_BridgeBralikClicked, null, c_playerAny);
}

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25747

void gt_BridgeCadeClicked_Init () {
    gt_BridgeCadeClicked = TriggerCreate("gt_BridgeCadeClicked_Func");
    TriggerAddEventUnitClick(gt_BridgeCadeClicked, null, c_playerAny);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/traynor03.sc2mapMapScript.galaxy:1548

    gt_TaurenOuthouseLaunch = TriggerCreate("gt_TaurenOuthouseLaunch_Func");
    TriggerEnable(gt_TaurenOuthouseLaunch, false);
    TriggerAddEventUnitClick(gt_TaurenOuthouseLaunch, UnitRefFromUnit(UnitFromId(1167)), c_playerAny);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:14890

void gt_PinboardItemClicked_Init () {
    gt_PinboardItemClicked = TriggerCreate("gt_PinboardItemClicked_Func");
    TriggerAddEventUnitClick(gt_PinboardItemClicked, null, c_playerAny);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:19230

    gt_DebugClick = TriggerCreate("gt_DebugClick_Func");
    TriggerEnable(gt_DebugClick, false);
    TriggerAddEventUnitClick(gt_DebugClick, null, c_playerAny);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:21921

void gt_HotspotClicked_Init () {
    gt_HotspotClicked = TriggerCreate("gt_HotspotClicked_Func");
    TriggerAddEventUnitClick(gt_HotspotClicked, null, c_playerAny);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25611

void gt_ArmoryKachinskiClicked_Init () {
    gt_ArmoryKachinskiClicked = TriggerCreate("gt_ArmoryKachinskiClicked_Func");
    TriggerAddEventUnitClick(gt_ArmoryKachinskiClicked, null, c_playerAny);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25655

void gt_ArmoryEarlClicked_Init () {
    gt_ArmoryEarlClicked = TriggerCreate("gt_ArmoryEarlClicked_Func");
    TriggerAddEventUnitClick(gt_ArmoryEarlClicked, null, c_playerAny);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25701

void gt_BridgeBralikClicked_Init () {
    gt_BridgeBralikClicked = TriggerCreate("gt_BridgeBralikClicked_Func");
    TriggerAddEventUnitClick(gt_BridgeBralikClicked, null, c_playerAny);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25747

void gt_BridgeCadeClicked_Init () {
    gt_BridgeCadeClicked = TriggerCreate("gt_BridgeCadeClicked_Func");
    TriggerAddEventUnitClick(gt_BridgeCadeClicked, null, c_playerAny);
}

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zchar03.sc2map/MapScript.galaxy:3342

void gt_TerranBiomassReaction_Init () {
    gt_TerranBiomassReaction = TriggerCreate("gt_TerranBiomassReaction_Func");
    TriggerAddEventUnitClick(gt_TerranBiomassReaction, UnitRefFromUnit(UnitFromId(351)), c_playerAny);
}

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zchar03.sc2mapMapScript.galaxy:3342

void gt_TerranBiomassReaction_Init () {
    gt_TerranBiomassReaction = TriggerCreate("gt_TerranBiomassReaction_Func");
    TriggerAddEventUnitClick(gt_TerranBiomassReaction, UnitRefFromUnit(UnitFromId(351)), c_playerAny);
}

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:20117

    libSwaC_gt_ZS_ArmyCustomEvolutionMasterClicked = TriggerCreate("libSwaC_gt_ZS_ArmyCustomEvolutionMasterClicked_Func");
    TriggerEnable(libSwaC_gt_ZS_ArmyCustomEvolutionMasterClicked, false);
    TriggerAddEventUnitClick(libSwaC_gt_ZS_ArmyCustomEvolutionMasterClicked, null, c_playerAny);
}

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:20182

    libSwaC_gt_ZS_ArmyCustomEggClicked = TriggerCreate("libSwaC_gt_ZS_ArmyCustomEggClicked_Func");
    TriggerEnable(libSwaC_gt_ZS_ArmyCustomEggClicked, false);
    TriggerAddEventUnitClick(libSwaC_gt_ZS_ArmyCustomEggClicked, null, c_playerAny);
}

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:20652

    libSwaC_gt_ZS_ArmyCustomEvolutionUnitClicked = TriggerCreate("libSwaC_gt_ZS_ArmyCustomEvolutionUnitClicked_Func");
    TriggerEnable(libSwaC_gt_ZS_ArmyCustomEvolutionUnitClicked, false);
    TriggerAddEventUnitClick(libSwaC_gt_ZS_ArmyCustomEvolutionUnitClicked, null, c_playerAny);
}

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:8355

    lib281DEC45_gt_ZSS_DebugUnitClickedDisplay = TriggerCreate("lib281DEC45_gt_ZSS_DebugUnitClickedDisplay_Func");
    TriggerEnable(lib281DEC45_gt_ZSS_DebugUnitClickedDisplay, false);
    TriggerAddEventUnitClick(lib281DEC45_gt_ZSS_DebugUnitClickedDisplay, null, c_playerAny);
}

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:12079

void lib281DEC45_gt_ZSS_CharacterClicked_Init () {
    lib281DEC45_gt_ZSS_CharacterClicked = TriggerCreate("lib281DEC45_gt_ZSS_CharacterClicked_Func");
    TriggerAddEventUnitClick(lib281DEC45_gt_ZSS_CharacterClicked, null, c_playerAny);
}

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pstory01.sc2map/MapScript.galaxy:1671

void gt_PylonClicked_Init () {
    gt_PylonClicked = TriggerCreate("gt_PylonClicked_Func");
    TriggerAddEventUnitClick(gt_PylonClicked, UnitRefFromVariable("gv_uNITBridgeSet03"), c_playerAny);
}

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pstory01.sc2mapMapScript.galaxy:1671

void gt_PylonClicked_Init () {
    gt_PylonClicked = TriggerCreate("gt_PylonClicked_Func");
    TriggerAddEventUnitClick(gt_PylonClicked, UnitRefFromVariable("gv_uNITBridgeSet03"), c_playerAny);
}

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:6608

void libVCST_gt_PS_ClickableClicked_Init () {
    libVCST_gt_PS_ClickableClicked = TriggerCreate("libVCST_gt_PS_ClickableClicked_Func");
    TriggerAddEventUnitClick(libVCST_gt_PS_ClickableClicked, null, c_playerAny);
}

mods/heroesmapmods/battlegroundmapmods/heavenhell.stormmodbase.stormdata/LibMLHH.galaxy:214

void libMLHH_gt_HHWeaponFlipped_Init () {
    libMLHH_gt_HHWeaponFlipped = TriggerCreate("libMLHH_gt_HHWeaponFlipped_Func");
    TriggerAddEventUnitClick(libMLHH_gt_HHWeaponFlipped, null, c_playerAny);
}

mods/heroesmapmods/battlegroundmapmods/towersofdoom.stormmodbase.stormdata/LibMTOD.galaxy:3338

void libMTOD_gt_MMToDSpiritHealerClicked_Init () {
    libMTOD_gt_MMToDSpiritHealerClicked = TriggerCreate("libMTOD_gt_MMToDSpiritHealerClicked_Func");
    TriggerAddEventUnitClick(libMTOD_gt_MMToDSpiritHealerClicked, null, c_playerAny);
}

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCST.galaxy:5431

void libNCST_gt_NS_ClickableClicked_Init () {
    libNCST_gt_NS_ClickableClicked = TriggerCreate("libNCST_gt_NS_ClickableClicked_Func");
    TriggerAddEventUnitClick(libNCST_gt_NS_ClickableClicked, null, c_playerAny);
}