Combatintermediate11 min readupdated 11 Sept 2026

Adding real recoil to FiveM weapons

The short answer

While the player is armed, check IsPedShooting(ped) every frame; when they fire, raise the camera with SetGameplayCamRelativePitch(GetGameplayCamRelativePitch() + kick, 0.2) using a per-weapon kick value. Skip the loop entirely when unarmed, handle first person and vehicles separately, and keep kick values small. weapons.meta recoil shake is visual only; the script changes where the player aims.

Vanilla GTA V guns barely move the aim, which makes sustained automatic fire a laser beam. Roleplay servers add recoil so a firefight takes skill and a rifle feels different from a pistol. Recoil in FiveM is a client script that nudges the camera upward every time the player fires. Done well it is subtle and weapon-specific; done badly it costs frames and fights the player’s mouse.

Adding real recoil to FiveM weapons — illustrated with a FiveM-compatible minimap render

#How scripted recoil works

The game tells you each frame whether the ped fired (IsPedShooting). When it did, you tilt the gameplay camera up by a small amount. Because the bullet goes where the camera points, the next shot lands higher unless the player pulls down — which is recoil control.

#A clean recoil script

client.lua
local KICK = {
    [`WEAPON_PISTOL`]         = 0.35,
    [`WEAPON_COMBATPISTOL`]   = 0.40,
    [`WEAPON_PISTOL50`]       = 0.90,
    [`WEAPON_SMG`]            = 0.35,
    [`WEAPON_CARBINERIFLE`]   = 0.55,
    [`WEAPON_ASSAULTRIFLE`]   = 0.65,
    [`WEAPON_PUMPSHOTGUN`]    = 1.40,
}
local DEFAULT_KICK = 0.45

CreateThread(function()
    while true do
        local ped = PlayerPedId()
        local _, weapon = GetCurrentPedWeapon(ped, true)

        if weapon == `WEAPON_UNARMED` or IsPedInAnyVehicle(ped, false) then
            Wait(500) -- nothing to do: check rarely
        else
            if IsPedShooting(ped) then
                local kick = KICK[weapon] or DEFAULT_KICK
                if GetFollowPedCamViewMode() == 4 then -- first person
                    kick = kick * 0.8
                end
                SetGameplayCamRelativePitch(GetGameplayCamRelativePitch() + kick, 0.2)
            end
            Wait(0)
        end
    end
end)
  • Backtick hashes make the table keys match GetCurrentPedWeapon directly.
  • The loop sleeps 500 ms when unarmed, so the cost is only paid while holding a gun.
  • View mode 4 is first person; the example reduces kick there because the view is closer.
  • Addon weapons fall back to DEFAULT_KICK unless you add them.

#Tuning by class

ClassKick per shot (degrees)Feel
Pistols0.3 – 0.5Quick, controllable
Heavy pistols / revolvers0.8 – 1.2One strong kick per shot
SMGs0.3 – 0.45Low per shot, adds up fast
Rifles0.5 – 0.7Needs pulling down on full auto
Shotguns1.2 – 2.0Big kick, low fire rate
Snipers1.5 – 2.5Scope jumps after each shot

Recoil interacts with damage and accuracy: a server with high recoil can afford higher damage because hits are harder. See weapon balance for roleplay.

#Vehicles and drive-bys

The example skips vehicles. Shooting from a car uses different cameras, and adding pitch there tends to feel wrong. Servers that want drive-by recoil usually use a smaller value and apply it only while aiming in a vehicle.

#Script recoil vs weapons.meta shake

weapons.meta has RecoilShakeHash, RecoilShakeHashFirstPerson and RecoilShakeAmplitude. Those produce a camera shake for feel, but the aim returns to where it was. A recoil script moves the aim itself. Many servers use both: meta shake for feel, script for control. The fields are explained in weapons.meta explained. The recoil fields themselves live in weapons.meta, and FAM Tools has an editor for it.

Share this guideXRedditFacebook

Questions

How do I add recoil in FiveM?
Run a client loop while armed that checks IsPedShooting(ped) and raises the camera with SetGameplayCamRelativePitch by a small per-weapon amount.
Does a recoil script lower performance?
Only if it runs every frame while unarmed. Sleep the loop when the player has no weapon out, and the cost is negligible.
Is recoil server-side?
No, it is client-side camera movement. That also means cheats can remove it, so do not rely on it for fairness alone.
What is the difference between recoil and camera shake?
Shake is visual and the aim returns; recoil moves the aim so the player must compensate.

Ready to pick a map?

Twelve themes on three base map styles, $8 each, instant download.

Relevant to what you just read

Look it up while you work

The reference tables this guide leans on, free and without an account.