Scripting/Client/Functions/SetCameraFov

(v0.4.4) Sets the camera field of view in degrees and moves there smoothly: it blends from the current value to fov over ms milliseconds (default 250, 0 = at once) with an ease-in/ease-out curve. The override stays until you change it: SetCameraFov(0) (or any value <= 0) blends back to whatever the game camera asks for (about 70 on foot), and the override ends. Calling it every frame with the same value is fine (the blend does not restart). The value is limited to 5 - 160. Typical use: aim-down-sights, SetCameraFov(40, 150) on right mouse button down and SetCameraFov(0, 150) on release. PC and Android.

Syntax

SetCameraFov(fov [, ms])

Arguments

Example

function onScriptLoad()
{
	SetCameraFov( 0.0 );
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: Input

Categories: Client functions | Input