Targets a unit. Passing nil is equivalent to calling ClearTarget()).

See also Targeting functions.


TargetUnit("unit") or TargetUnit("name" [, exactMatch])


  • unit - A unit to target (string, unitID)
  • name - Name of a unit to target (string)
  • exactMatch - True to check only units whose name exactly matches the name given; false to allow partial matches (boolean)
This function is protected and can only be called by the Blizzard user interface