How do you make a good recoil?

I haven’t seen many people show how to actually make a good recoil.

I am trying to make a recoil for my game that is TPS / FPS.
The first person arms are not FPS Arms, they’re just the normal player arms.

Here is an example of what I want to achieve:


(Game link: https://www.roblox.com/games/4588604953/Criminality-BETA?refPageId=90359172-93fc-4bab-9a16-4410207eeeec)


local RunService = game:GetService("RunService")
local Camera = game.Workspace.CurrentCamera
local Mouse = game.Players.LocalPlayer:GetMouse()

local RecoilCFrame = CFrame.Angles(0,0,0)
local RecoilAmount = math.rad(1.6)

RunService.RenderStepped:Connect(function(dt)
    Mouse.TargetFilter = Camera

    Camera.CFrame =  (
        Camera.CFrame
            * RecoilCFrame)

    RecoilCFrame:Lerp(CFrame.Angles(0,0,0),0.1)

end)

local function shoot() 
    
    RecoilCFrame = RecoilCFrame:Lerp(CFrame.Angles(RecoilAmount,0,0),0.1)
    
end

local MouseDown = true

Mouse.MouseButton1Down:Connect(function()
    MouseDown = true
    repeat wait(0.1)
        shoot()
    until MouseDown == false
end)

Mouse.MouseButton1Up:Connect(function()
    MouseDown = false    
end)

Script I use ^

I would really like to achieve something similar to that in the video
If anyone can help let me know.

1 Like
local RunService = game:GetService(“RunService”)
local Camera = game.Workspace.CurrentCamera
local Mouse = game.Players.LocalPlayer:GetMouse()

local RecoilCFrame = CFrame.Angles(0,0,0)

RunService.RenderStepped:Connect(function(dt)
Mouse.TargetFilter = Camera

Camera.CFrame = (
Camera.CFrame
* RecoilCFrame)

RecoilCFrame:Lerp(CFrame.Angles(0,0,0),0.1)

end)

local function shoot()

RecoilCFrame = RecoilCFrame:Lerp(CFrame.Angles(math.rad(1.6),0,0),0.1)

end

local MouseDown = true

Mouse.MouseButton1Down:Connect(function()
MouseDown = true
repeat wait(0.1)
shoot()
until MouseDown == false
end)

Mouse.MouseButton1Up:Connect(function()
MouseDown = false
end)

Formatted better.

Personally, I like the Spring module used in the tutorial below. This particular tutorial uses custom arms but I’d assume the same concept would work

Aforementioned post:

6 Likes