Returns whether a unit is controlling a vehicle or vehicle weapon. Used in the default UI to show the vehicle's health and power status bars in place of the controlling unit's. Returns false for passengers riding in but not controlling part of a vehicle; to find out whether a unit is riding in a vehicle, use UnitInVehicle
. Also note that in some vehicles the player can command a vehicle weapon (e.g. gun turret) without controlling the vehicle itself; to find out whether a unit is controlling a vehicle, use UnitControllingVehicle
.
See also Vehicle functions.
Signature:
hasVehicle
=
UnitHasVehicleUI("unit")
or
UnitHasVehicleUI("name")
Arguments:
unit
- A unit to query (string
, unitID)name
- The name of a unit to query; only valid forplayer
,pet
, and party/raid members (string
)
Returns:
hasVehicle
- True if the unit is controlling a vehicle or vehicle weapon; otherwise false (boolean
)