# Name of Unit
Grammar — Name of unit
Flags —Native
|Function
Returns the name of a specific unit. This function should be preferred if you wish to account for behavior-based name overrides rather than displaying the name of the unit type.
# Arguments
unit
— Unit
Returns — text
native text UnitGetName(unit inUnit);
# Related
Category: Unit / Basic
- [F] —
void
— Unit Show Kill Display — ( UnitShowKillDisplay ) - [F] —
bool
— Unit Can Path To Point — ( UnitPathableToPoint ) - [F] —
bool
— Unit Can Path To Unit — ( UnitPathableToUnit ) - [F] —
void
— Create Units With Default Facing — ( libNtve_gf_CreateUnitsWithDefaultFacing ) - [F] —
void
— Create Units With Point Facing — ( libNtve_gf_CreateUnitsAtPoint2 ) - [F] —
unitgroup
— Create Units Facing Angle — ( UnitCreate ) - [F] —
unitgroup
— Create Units Facing Point — ( libNtve_gf_UnitCreateFacingPoint ) - [F] —
unit
— Last Created Unit — ( UnitLastCreated ) - [F] —
unitgroup
— Last Created Units — ( UnitLastCreatedGroup ) - [F] —
unit
— Original Caster Of Unit — ( UnitGetOriginalCaster ) - [F] —
string
[ gamelink::Effect ] — Effect That Created Unit — ( UnitGetOriginalEffect ) - [F] —
void
— Replace Unit — ( libNtve_gf_ReplaceUnit ) - [F] —
unit
— Last Replaced Unit — ( libNtve_gf_LastReplacedUnit ) - [F] —
void
— Change Owner — ( UnitSetOwner ) - [F] —
void
— Unit Owner Changes — ( TriggerAddEventUnitChangeOwner ) - [F] —
int
— Old Unit Owner — ( EventUnitOwnerOld ) - [F] —
int
— New Unit Owner — ( EventUnitOwnerNew ) - [F] —
void
— Rescue Unit — ( libNtve_gf_RescueUnit ) - [F] —
void
— Rescue Unit Group — ( libNtve_gf_RescueUnit2 ) - [F] —
void
— Kill Unit — ( UnitKill ) - [F] —
void
— Revive Unit — ( UnitRevive ) - [F] —
void
— Remove Unit — ( UnitRemove ) - [F] —
int
— Owner Of Unit — ( UnitGetOwner ) - [F] —
bool
— Unit Is Alive — ( UnitIsAlive ) - [F] —
bool
— Unit Is Valid — ( UnitIsValid ) - [F] —
bool
— Unit Group Is Dead — ( libNtve_gf_UnitGroupIsDead ) - [F] —
void
— Move Unit Instantly — ( UnitSetPosition ) - [F] —
void
— Make Unit Face Angle — ( UnitSetFacing ) - [F] —
void
— Make Unit Face Point — ( libNtve_gf_MakeUnitFacePoint ) - [F] —
point
— Position Of Unit — ( UnitGetPosition ) - [F] —
point
— Goal Position Of Unit — ( UnitGetGoalPosition ) - [F] —
fixed
— Facing Angle Of Unit — ( UnitGetFacing ) - [F] —
void
— Pause/Unpause Unit — ( libNtve_gf_PauseUnit ) - [F] —
void
— Pause/Unpause All Units — ( UnitPauseAll ) - [F] —
void
— Sleep/WakeUp Unit — ( libNtve_gf_SleepUnit ) - [F] —
void
— Show/Hide Unit — ( libNtve_gf_ShowHideUnit ) - [F] —
void
— Share Vision of Unit — ( libNtve_gf_ShareVisionofUnit ) - [F] —
bool
— Unit Is Paused — ( libNtve_gf_UnitIsPaused ) - [F] —
bool
— Unit Is Sleepiing — ( libNtve_gf_UnitIsSleepiing ) - [F] —
bool
— Unit Is Hidden — ( libNtve_gf_UnitIsHidden ) - [F] —
bool
— Unit Is Visible To Player — ( libNtve_gf_UnitIsVisibleToPlayer ) - [F] —
void
— Set Unit Custom Value — ( UnitSetCustomValue ) - [F] —
fixed
— Custom Value Of Unit — ( UnitGetCustomValue ) - [F] —
void
— Unit Enters/Leaves Region — ( TriggerAddEventUnitRegion ) - [F] —
region
— Triggering Region — ( EventUnitRegion ) - [F] —
void
— Unit Enters/Leaves Point — ( TriggerAddEventUnitRangePoint ) - [F] —
void
— Unit Enters/Leaves Range Of Unit — ( TriggerAddEventUnitRange ) - [F] —
unit
— Triggering Range Unit — ( EventUnitRangeUnit ) - [F] —
bool
— Unit In Region — ( libNtve_gf_UnitInRegion ) - [F] —
unit
— Triggering Unit — ( EventUnit ) - [F] —
void
— Load Unit Model — ( UnitLoadModel ) - [F] —
void
— Unload Unit Model — ( UnitUnloadModel ) - [F] —
unit
— Agent Of Player For Unit — ( UnitAgent ) - [F] —
void
— Change Empty Unit Variables In Events — ( UnitEventSetNullVariableInvalid ) - [F] —
text
— Name of Unit — ( UnitGetName ) - [F] —
int
— Ideal Harvester Count — ( UnitIdealWorkerCount ) - [F] —
int
— Current Harvester Count — ( UnitCurrentWorkerCount )
# Examples
# mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmod
// L5837
UnitGetName(libGame_gv_players[libNtve_gf_KillingPlayer()].lv_heroUnit)
// L6635
UnitGetName(libGame_gv_players[libGame_gf_HeroKilledKillingPlayer()].lv_heroUnit)
// L10782
UnitGetName(libGame_gv_players[lv_casterPlayer].lv_heroUnit)
// L10784
UnitGetName(libGame_gv_players[lv_targetPlayer].lv_heroUnit)
// L10810
UnitGetName(libGame_gv_players[lv_casterPlayer].lv_heroUnit)
// L10812
UnitGetName(libGame_gv_players[lv_targetPlayer].lv_heroUnit)
// L4543
UnitGetName(libNtve_gf_KillingUnit())
// L5219
UnitGetName(libGame_gv_players[libGame_gf_HeroKilledKillingPlayer()].lv_heroUnit)
// L5226
UnitGetName(libGame_gv_players[libGame_gf_HeroKilledKillingPlayer()].lv_heroUnit)
# mods/heroesbrawlmods/brawlmapmods/coop/pvebrawlmod.stormmod
// L930
UnitGetName(libGame_gv_players[lp_playerIndex].lv_heroUnit)
// L2342
UnitGetName(lv_targetHero)
// L2344
UnitGetName(lv_caster)
// L2410
UnitGetName(lv_resurrecter)
// L2473
UnitGetName(lv_itUnit)
# mods/heroesbrawlmods/brawlmapmods/coop/pvemod.stormmod
// L488
UnitGetName(libGame_gv_players[lp_playerIndex].lv_heroUnit)
// L1897
UnitGetName(lv_targetHero)
// L1899
UnitGetName(lv_caster)
// L1963
UnitGetName(lv_resurrecter)
// L2030
UnitGetName(lv_itUnit)
# mods/heroesbrawlmods/brawlmapmods/coop/pvemod.stormmod
// L1397
UnitGetName(lp_boss)
# mods/heroesdata.stormmod
// L8827
UnitGetName(auto8C3F4A95_var)
# mods/heroesdata.stormmod
// L4586
UnitGetName(lv_itHero)
// L7117
UnitGetName(lv_transportUnit)
// L7282
UnitGetName(lv_targetUnit)
// L7474
UnitGetName(lp_targetUnit)
// L7743
UnitGetName(lp_targetUnit)
// L7878
UnitGetName(lp_targetUnit)
// L7979
UnitGetName(lp_pingedUnit)
// L8071
UnitGetName(lp_pingedUnit)
// L8096
UnitGetName(lp_pingedUnit)
// L8196
UnitGetName(lv_pingingPlayerHero)
# mods/heroesmapmods/battlegroundmapmods/alteracpass.stormmod
// L496
UnitGetName(lv_closestEnemy)
// L2652
UnitGetName(lv_defenderUnit)
# mods/heromods/auriel.stormmod
// L175
UnitGetName(lp_unit)
# mods/novastoryassets.sc2mod
// L7317
UnitGetName(UnitFromId(895))
// L7323
UnitGetName(UnitFromId(1340))
// L7317
UnitGetName(UnitFromId(895))
// L7323
UnitGetName(UnitFromId(1340))
# mods/starcoop/starcoop.sc2mod
// L15458
UnitGetName(EventUnit())
// L15465
UnitGetName(EventUnit())
# mods/starcoop/starcoop.sc2mod
// L13848
UnitGetName(UnitLastCreated())
# mods/starcoop/starcoop.sc2mod
// L3021
UnitGetName(libCOUI_gv_cU_HeroUnit[lp_index][lp_player])
# mods/warcoop/warclassic.sc2mod
// L1066
UnitGetName(lv_u)
# mods/warcoop/warmeleeai.sc2mod
// L326
UnitGetName(lv_u)