# Owner Of Unit
Grammar — Owner of u
Flags —Native
|Function
Returns the owner of a unit.
# Arguments
unit
— Unit
Returns — int
native int UnitGetOwner(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
# campaigns/liberty.sc2campaign
// L258
UnitGetOwner(UnitGroupLoopCurrent())
// L476
UnitGetOwner(EventUnit())
// L750
UnitGetOwner(EventUnit())
// L750
UnitGetOwner(EventUnit())
// L1554
UnitGetOwner(EventUnit())
// L1765
UnitGetOwner(EventUnit())
// L2337
UnitGetOwner(EventUnit())
// L2337
UnitGetOwner(EventUnit())
// L2465
UnitGetOwner(EventUnit())
// L2506
UnitGetOwner(EventUnit())
// L2549
UnitGetOwner(EventUnit())
// L2608
UnitGetOwner(EventUnit())
// L2673
UnitGetOwner(EventUnit())
// L549
UnitGetOwner(EventUnit())
// L787
UnitGetOwner(EventUnit())
// L982
UnitGetOwner(EventUnitProgressUnit())
// L598
UnitGetOwner(EventUnit())
// L603
UnitGetOwner(EventUnit())
// L620
UnitGetOwner(EventUnit())
// L884
UnitGetOwner(EventUnitProgressUnit())
// L916
UnitGetOwner(EventUnit())
// L946
UnitGetOwner(EventUnit())
// L951
UnitGetOwner(EventUnit())
// L968
UnitGetOwner(EventUnit())
// L1584
UnitGetOwner(EventUnit())
// L2183
UnitGetOwner(EventUnit())
// L2183
UnitGetOwner(EventUnit())
// L2310
UnitGetOwner(EventUnit())
// L2350
UnitGetOwner(EventUnit())
// L2391
UnitGetOwner(EventUnit())
// L2449
UnitGetOwner(EventUnit())
// L2514
UnitGetOwner(EventUnit())
// L243
UnitGetOwner(UnitGroupLoopCurrent())
// L465
UnitGetOwner(EventUnit())
// L736
UnitGetOwner(EventUnit())
// L394
UnitGetOwner(UnitGroupLoopCurrent())
// L1671
UnitGetOwner(EventUnit())
// L2292
UnitGetOwner(EventUnit())
// L2292
UnitGetOwner(EventUnit())
// L2431
UnitGetOwner(EventUnit())
// L2483
UnitGetOwner(EventUnit())
// L2536
UnitGetOwner(EventUnit())
// L2594
UnitGetOwner(EventUnit())
// L2659
UnitGetOwner(EventUnit())
// L263
UnitGetOwner(UnitGroupLoopCurrent())
// L462
UnitGetOwner(EventUnit())
// L718
UnitGetOwner(EventUnit())
// L718
UnitGetOwner(EventUnit())
// L1801
UnitGetOwner(gv_boss)
// L2302
UnitGetOwner(gv_boss)
// L2329
UnitGetOwner(gv_boss)
// L2353
UnitGetOwner(gv_boss)
// L2366
UnitGetOwner(gv_boss)
// L5823
UnitGetOwner(gv_boss)
// L5829
UnitGetOwner(gv_boss)
// L5851
UnitGetOwner(gv_boss)
// L5857
UnitGetOwner(gv_boss)
// L7298
UnitGetOwner(EventUnit())
// L1307
UnitGetOwner(EventUnit())
// L1469
UnitGetOwner(EventUnit())
// L1606
UnitGetOwner(EventUnitTargetUnit())
// L1609
UnitGetOwner(EventUnitTargetUnit())
// L1846
UnitGetOwner(EventUnit())
// L2558
UnitGetOwner(EventUnit())
// L2668
UnitGetOwner(EventUnit())
// L2668
UnitGetOwner(EventUnitTarget())
// L2718
UnitGetOwner(EventUnit())
// L2750
UnitGetOwner(EventUnit())
// L280
UnitGetOwner(lp_u)
// L1871
UnitGetOwner(EventUnit())
// L2130
UnitGetOwner(EventUnit())
// L2213
UnitGetOwner(EventUnit())
// L2386
UnitGetOwner(EventUnit())
// L2671
UnitGetOwner(EventUnit())
// L2848
UnitGetOwner(libNtve_gf_KillingUnit())
// L4224
UnitGetOwner(EventUnit())
// L1268
UnitGetOwner(EventUnit())
// L1364
UnitGetOwner(EventUnit())
// L1474
UnitGetOwner(EventUnit())
// L1588
UnitGetOwner(EventUnit())
// L1695
UnitGetOwner(EventUnit())
// L2314
UnitGetOwner(EventUnit())
// L2378
UnitGetOwner(EventUnit())
// L2442
UnitGetOwner(EventUnit())
// L2503
UnitGetOwner(EventUnit())
// L2553
UnitGetOwner(EventUnit())
// L567
UnitGetOwner(lv_overlord)
// L1382
UnitGetOwner(EventUnitTargetUnit())
// L1655
UnitGetOwner(EventUnit())
// L1655
UnitGetOwner(EventUnit())
// L2127
UnitGetOwner(auto97CB6B13_var)
// L2329
UnitGetOwner(EventUnit())
// L2333
UnitGetOwner(EventUnit())
// L2433
UnitGetOwner(EventUnit())
// L3393
UnitGetOwner(libNtve_gf_KillingUnit())
// L3397
UnitGetOwner(EventUnit())
// L426
UnitGetOwner(lp_diamondback)
// L436
UnitGetOwner(lp_diamondback)
// L2371
UnitGetOwner(EventUnit())
// L2488
UnitGetOwner(EventUnit())