SetUnitFacingTimed
- Parameters
-
whichUnit unit
Target unit.
facingAngle real
New angle in degrees (direction), see:
SetUnitFacing
.duration real
Value >= 0 and < 1: same turn speed as
SetUnitFacing
.Values >= 1 seem to be applied like a multiplier, slowing down the turn speed.
- comment
Makes the unit slowly turn around on the spot to look at new direction, the turn speed can be modified with
duration
.- note
Not affected by
GetUnitTurnSpeed
/SetUnitTurnSpeed
.- note
If
duration < 0.1
, while the unit is moving, calling this function will have no effect.- bug
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)
- bug
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)
- patch
1.00
- Source
- common.j
- return type
nothing
- Source code
native SetUnitFacingTimed takes unit whichUnit, real facingAngle, real duration returns nothing