Returns whether the player is close enough to a unit for certain types of interaction


See also Unit functions.

Signature:

canInteract = CheckInteractDistance("unit", distIndex)

Arguments:

  • unit - A unit to query (string, unitID)
  • distIndex - Number identifying one of the following action types (number)
    • 1 - Inspect
    • 2 - Trade
    • 3 - Duel
    • 4 - Follow

Returns:

  • canInteract - 1 if the player is close enough to the other unit to perform the action; otherwise nil (1nil)