GetPlayerYaw
The direction the player faces, in degrees.
The game’s convention: 0 faces +Y, 90 faces -X, 180 faces -Y, 270 faces +X - counter-clockwise seen from above.
Syntax
Section titled “Syntax”GetPlayerYaw(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”number - degrees 0..360; 0 when not connected
Example
Section titled “Example”-- two metres in front of the playerlocal x, y, z = GetPlayerPos(pid)local r = math.rad(GetPlayerYaw(pid))local fx, fy = x - math.sin(r) * 2, y + math.cos(r) * 2See also
Section titled “See also”GetPlayerPos · SetPlayerPos · the Players group of the index
