setCameraFieldOfView | Multi Theft Auto: Wiki Skip to content

setCameraFieldOfView

Client-side
Server-side
Shared

Pair: getCameraFieldOfView

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 field of view of the dynamic camera - this is the field of view of the non-fixed camera - yes, the camera that the user can control whilst on foot or in a vehicle. The higher the field of view angle, the more you will be able to see to your sides.

Note

This function omits (but doesn't override) the user game option in Settings -> Video -> FOV

Note

It doesn't affect the FOV for the following camera modes: 1) Player aiming 2) Vehicle front bumper camera 3) Fixed camera

Syntax

setCameraFieldOfView ( )

Code Examples

client

In this example, the field of view for 'player walking/running' camera is set to 20, once resource fully starts.

local function changeCameraFovOnClientResourceStart()
setCameraFieldOfView("player", 20)
end
addEventHandler("onClientResourceStart", resourceRoot, changeCameraFovOnClientResourceStart)