Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!
Determines if the unit exists.
exists = UnitExists("unit")
- String (UnitId) - The unit to query (e.g. "player", "party2", "pet", "target" etc.)
- Flag - 1 if the unit exists and is in the current zone, or nil if not
The snippet below prints a message describing what the player is targeting.
if UnitExists("target") then print("You're targeting a " .. UnitName("target")) else print("You have no target") end