Target unit.
New angle in degrees (direction), see: SetUnitFacing
.
Value >= 0 and < 1: same turn speed as SetUnitFacing
.
Values >= 1 seem to be applied like a multiplier, slowing down the turn speed.
Not affected by GetUnitTurnSpeed
/SetUnitTurnSpeed
.
If duration < 0.1
, while the unit is moving, calling this function will have no effect.
For duration == 0.5
the footman plays the running animation while turning.
uf1 = CreateUnit(Player(0), FourCC("hfoo"), -128, 0, 90)
uf2 = CreateUnit(Player(0), FourCC("hfoo"), 128, 0, 90)
SetUnitFacing(uf1, -90)
SetUnitFacingTimed(uf2, -90, 0.5)
For duration
values other than zero, the final angle is different
than the requested angle, even when called repeatedly.
SetUnitFacing(uf1, 90)
SetUnitFacingTimed(uf2, 90, 1) --> final angle = 96.91184 (expected 90)
Generated using TypeDoc
Makes the unit slowly turn around on the spot to look at new direction, the turn speed can be modified with
duration
.