getCameraFieldOfView | Multi Theft Auto: Wiki Skip to content

getCameraFieldOfView

Client-side
Server-side
Shared

Pair: setCameraFieldOfView

This function returns the field of view of the dynamic camera as set by setCameraFieldOfView.

OOP Syntax Help! I don't understand this!

  • Method:Camera.getFieldOfView(...)
  • Variable: .fov

Syntax

float getCameraFieldOfView ( string cameraMode )
Required Arguments
  • cameraMode: The camera mode to get the field of view.
    • player: whilst walking/running
    • vehicle: whilst in vehicle
    • vehicle_max: the max the field of view can go to when the vehicle is moving at a high speed (must be higher than "vehicle")

Returns

  • float: fov

Returns one float - the field of view angle.

Code Examples

client

In this example, the field of view is output to the chat whenever the /getfov command is written.

function getCamFOV()
outputChatBox("The camera field of view for 'player walking/running' is: " .. getCameraFieldOfView("player"))
end
addCommandHandler("getfov", getCamFOV)