CreateThread(function()
local camera = CreateCam("DEFAULT_SCRIPTED_FLY_CAMERA", true)
-- Set the cam coordinates to the player coords
local playerCoords = GetEntityCoords(PlayerPedId())
SetCamCoord(camera, playerCoords)
-- Render the camera we just created
RenderScriptCams(true)
-- Use a shallow depth of field
SetCamUseShallowDofMode(camera, true)
-- Set at what distance your camera should start to focus (Example: 0.7 meters)
SetCamNearDof(camera, 0.7)
-- Set at what distance your camera should stop focusing (Example: 1.3 meters)
SetCamFarDof(camera, 1.3)
-- Apply 100% of the DoF effect (The native you're reading documentation on)
SetCamDofStrength(camera, 1.0)
while DoesCamExist(camera) do
-- Use DoF effect (needs to be called every tick)
SetUseHiDof()
Citizen.Wait(0)
end
end)