setPedCameraRotation
Client-side
Server-side
Shared
Pair: getPedCameraRotation
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function sets the camera rotation of a ped, e.g. where its camera will look at. Don't confuse this with getCameraMatrix, because that function is designed for fixed (scripted) camera moves.
Note
getPedCameraRotation may not return the value set by this function. Please refer to getPedCameraRotation for details.
Syntax
setPedCameraRotation ( )Code Examples
client
The next code snippet adds a command called /rotatecam, which rotates the camera of the player who uses it.
function rotateLocalPlayerCamera() --setPedCameraRotation(localPlayer, getPedCameraRotation(localPlayer) + 45) -- This would work if getPedCameraRotation returned non-transformed angles setPedCameraRotation(localPlayer, -(getPedCameraRotation(localPlayer) + 45)) -- Tranform the angle returned and then add 45º to it outputChatBox("Your camera was rotated 45 degrees counter clockwise.", 0, 255, 0)endaddCommandHandler("rotatecam", rotateLocalPlayerCamera)See Also
Ped Functions
- addPedClothes
- canPedBeKnockedOffBike
- createPed
- getPedAmmoInClip
- getPedAnalogControlState
- getPedAnimation
- getPedArmor
- getPedBonePosition
- getPedCameraRotation
- getPedClothes
- getPedContactElement
- getPedControlState
- getPedFightingStyle
- getPedGravity
- getPedMoveState
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedOxygenLevel
- getPedSimplestTask
- getPedStat
- getPedTarget
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedTotalAmmo
- getPedVoice
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponMuzzlePosition
- getPedWeaponSlot
- getValidPedModels
- givePedWeapon
- isPedBleeding
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDoingTask
- isPedDucked
- IsPedFootBloodEnabled
- isPedHeadless
- isPedInVehicle
- isPedOnGround
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- isPedWearingJetpack
- killPed
- playPedVoiceLine
- reloadPedWeapon
- removePedClothes
- removePedFromVehicle
- resetPedVoice
- setPedAimTarget
- setPedAnalogControlState
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedChoking
- setPedControlState
- setPedDoingGangDriveby
- setPedEnterVehicle
- setPedExitVehicle
- setPedFightingStyle
- setPedFootBloodEnabled
- setPedGravity
- setPedHeadless
- setPedLookAt
- setPedOxygenLevel
- setPedStat
- setPedTargetingMarkerEnabled
- setPedVoice
- setPedWalkingStyle
- setPedWeaponSlot
- setPedWearingJetpack
- warpPedIntoVehicle