SetUnitOwner

Parameters
whichUnit unit

Unit to modify.

whichPlayer player

The unit's new owner.

changeColor boolean

True to update unit's tinting color to new owner's color, false to leave old color.

comment

Changes ownership of a unit.

note

New color is only applied if the unit really changed ownership from one player to another.

note

Reforged: The HP bar will always have the color of its owner player, regardless of changeColor.

note

See: GetOwningPlayer, Player, SetUnitColor, BlzSetSpecialEffectColorByPlayer.

patch

1.00

Source
common.j
return type
nothing
Source code
native          SetUnitOwner        takes unit whichUnit, player whichPlayer, boolean changeColor returns nothing