M MY Multiplayer: Wiki
Side
Kind

setPedCameraRotation

Client

Changes where a ped's camera faces. On the local player it turns the game camera; on a ped it is the direction it looks and aims.

bool setPedCameraRotation(ped thePed, float rotation)

Parameters

NameTypeDescription
thePedpedThe ped or player. For any element, the function also applies to the elements below it, and the result is the element's own.
rotationfloatThe rotation in degrees, around the vertical axis.

Returns

true if the rotation was applied. false if the element is not a ped or player.

Example

local ped = createPed("male01", 2495.0, -1685.0, 13.5)
setPedCameraRotation(ped, 90)
setPedControlState(ped, "aim_weapon", true)

See also