{"hash":"0x27666E5988D9D429","ns":"CAMERA","name":"SET_CAM_FOV","slug":"SET_CAM_FOV","official":true,"named":true,"luaName":"SetCamFov","game":"rdr3","apiset":"client","returnType":"void","params":[{"name":"cam","type":"Cam"},{"name":"fieldOfView","type":"float","description":"Vertical field of view in degrees, as a float."}],"summary":"Sets a scripted camera's field of view. The value must be a real float.","descriptions":[{"source":"alloc8or","format":"text","body":"Sets the field of view of the cam.\n\nMin: 1.0f\nMax: 130.0f"}],"examples":[],"aliases":[],"enums":[],"related":["0x40C23491CE83708E","0x8101D32A0A6B0F60"],"build":"1207","gtaHash":"0xB13C14F66A00D047","gtaJhash":"0xD3D5D74F","sources":["alloc8or","overlay"],"doc":3,"overlayFile":"overlay/natives/0x27666E5988D9D429.md","noteMeta":{"contributors":["borderline-rp"],"tags":["camera","float","nui","gotcha"]},"notes":"A whole number coming from NUI or JSON (a slider value `35`, a stored `1.0` serialised as `1`) arrives in Lua 5.4 as an integer. Passed here it is read as the wrong bits and ignored: no error, the FOV just does not change.\n\nIt is easy to miss: interpolated values are already floats, so a camera path with several keyframes works and one with a single keyframe does not.\n\n```lua\nSetCamFov(cam, (tonumber(data.fov) or 50) + 0.0)\n```\n\nThis applies to every float parameter of every native. Integers that really are integers (handles, hashes, hours) must not be converted.\n\nVerified in game on the Borderline RP server, September 2026.","url":"https://natives.borderlinerp.com/natives/CAMERA/SET_CAM_FOV","markdownUrl":"https://natives.borderlinerp.com/natives/CAMERA/SET_CAM_FOV.md","snippets":{"lua":"SetCamFov(cam, fieldOfView)","luaInvoke":"Citizen.InvokeNative(0x27666E5988D9D429, cam, fieldOfView)","js":"SetCamFov(cam, fieldOfView);","jsInvoke":"Citizen.invokeNative('0x27666E5988D9D429', cam, fieldOfView + 0.0000001);","csharp":"Function.Call((Hash)0x27666E5988D9D429, cam, fieldOfView);","notes":["Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason."]}}