# Unit Starts Attacking

Grammaru starts attacking with weapon
FlagsNative | Event

This event fires when a unit starts attacking. Use “Attacking Unit” or “Triggering Unit” to get the attacker. Use “Triggering Player” to get the owner of the attacker.

# Arguments

  • unitref [ unit ] — Unit
  • string [ gamelink::Weapon ] — Weapon

Returns — void

native void TriggerAddEventUnitStartedAttack2(
	trigger t,
	unitref u,
	string inWeapon,
);

Category: Unit / Combat

# Examples

# campaigns/swarm.sc2campaign

MapScript.galaxy

// L2080
TriggerAddEventUnitStartedAttack2(gt_HybridStartsAttackingQ, UnitRefFromUnit(UnitFromId(1485)), null)
// L2080
TriggerAddEventUnitStartedAttack2(gt_HybridStartsAttackingQ, UnitRefFromUnit(UnitFromId(1485)), null)
// L3083
TriggerAddEventUnitStartedAttack2(gt_ThorBark1Q, UnitRefFromUnit(UnitFromId(624)), null)
// L3124
TriggerAddEventUnitStartedAttack2(gt_HybridTauntQ, UnitRefFromUnit(UnitFromId(481)), null)
// L3083
TriggerAddEventUnitStartedAttack2(gt_ThorBark1Q, UnitRefFromUnit(UnitFromId(624)), null)
// L3124
TriggerAddEventUnitStartedAttack2(gt_HybridTauntQ, UnitRefFromUnit(UnitFromId(481)), null)

# mods/heromods/chromie.stormmod

LibHCHR.galaxy

// L193
TriggerAddEventUnitStartedAttack2(libHCHR_gt_HeroChromieSandEchoBasicAttackAnimationBegins, null, "ChromieHeroWeapon")

# mods/novastoryassets.sc2mod

MapScript.galaxy

// L3748
TriggerAddEventUnitStartedAttack2(gt_TrooperFindsNovaQ, null, null)
// L4385
TriggerAddEventUnitStartedAttack2(gt_SnipeHallReaperFindsNovaQ, null, null)
// L2546
TriggerAddEventUnitStartedAttack2(gt_DOMUnitsEngagingTargetTransmissionsQ, null, null)
// L3948
TriggerAddEventUnitStartedAttack2(gt_S1CombatInDefendRegionsController, null, null)
// L5791
TriggerAddEventUnitStartedAttack2(gt_S2CombatInDefendRegionsController, null, null)
// L3748
TriggerAddEventUnitStartedAttack2(gt_TrooperFindsNovaQ, null, null)
// L4385
TriggerAddEventUnitStartedAttack2(gt_SnipeHallReaperFindsNovaQ, null, null)
// L2546
TriggerAddEventUnitStartedAttack2(gt_DOMUnitsEngagingTargetTransmissionsQ, null, null)
// L3948
TriggerAddEventUnitStartedAttack2(gt_S1CombatInDefendRegionsController, null, null)
// L5791
TriggerAddEventUnitStartedAttack2(gt_S2CombatInDefendRegionsController, null, null)

# mods/warcoop/warclassic.sc2mod

WarClassic.galaxy

// L54
TriggerAddEventUnitStartedAttack2(t,ur,weapon)