Returns whether the spell currently awaiting a target can target a given unit. Only applies when the player has attempted to cast a spell but the spell requires a target before it can begin casting (i.e. the glowing hand cursor is showing).


See also Targeting functions, Spell functions.

Signature:

canTarget = SpellCanTargetUnit("unit") or SpellCanTargetUnit("name")

Arguments:

  • unit - A unit to target (string, unitID)
  • name - The name of a unit to target; only valid for player, pet, and party/raid members (string)

Returns:

  • canTarget - 1 if the spell currently awaiting targeting can target the given unit (1nil)