WoW:API UnitName
name = UnitName("unit");
Returns the name of the specified unit.
- Arguments
- (unit)
- unit
- String - The UnitId to query (e.g. "player", "party2", "pet", "target" etc.)
- Returns
- name
- name
- String - The name of the specified unit.
- Example
local playerName = UnitName("player");
ChatFrame1:AddMessage('Hi my name is: ' .. playerName);
- Result
Prints the player's name to the chat frame as 'Hi my name is: Octon'.
- Description
- Returns the name of the specified unit.