Skip to content

TurnActor

Turns a standing actor to face a direction.

TurnActor(id, yaw)
Parameter Type
id number the actor
yaw number degrees; 0 = facing +Y, counter-clockwise

boolean - false for anything but an actor

-- face the player
local px, py = GetPlayerPos(pid)
local ax, ay = GetEntityPos(guard)
TurnActor(guard, math.deg(math.atan(-(px - ax), py - ay)) % 360)

MoveActor · StopActor · the NPC actors group of the index