TurnActor
Turns a standing actor to face a direction.
Syntax
Section titled “Syntax”TurnActor(id, yaw)| Parameter | Type | |
|---|---|---|
id |
number | the actor |
yaw |
number | degrees; 0 = facing +Y, counter-clockwise |
Returns
Section titled “Returns”boolean - false for anything but an actor
Example
Section titled “Example”-- face the playerlocal px, py = GetPlayerPos(pid)local ax, ay = GetEntityPos(guard)TurnActor(guard, math.deg(math.atan(-(px - ax), py - ay)) % 360)See also
Section titled “See also”MoveActor · StopActor · the NPC actors group of the index
