Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to create a jerk effect when shooting a gun on Roblox?

Asked by 7 years ago

I've tried with so many things, I played around with camera and mouse properties/functions. I still can't figure out how to create that effect and it's crucial for my game. Here's what I done, but nothing. This is in a Local Script, game>StarterScripts>

local Player = game.Players.LocalPlayer
local Camera = workspace.CurrentCamera
local mouse = Player:GetMouse()

function tilt(inputObject)
    if inputObject.KeyCode == Enum.KeyCode.E then
        local JerkUp = CFrame.new(mouse.Hit * Vector3.new(0,0.5,0))
        Camera.Focus = JerkUp
    end
end
game:GetService("UserInputService").InputBegan:connect(tilt)
1
Camera.CFrame = Camera.CFrame * CFrame.Angles(0,math.rad(1),0) RubenKan 3615 — 7y
2
Also, its called Recoil, not 'Jerk effect' RubenKan 3615 — 7y
0
Thank you... GeezuzFusion 200 — 7y

1 answer

Log in to vote
1
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago

If my comment got you to your solution, you should put solved in the title and accept this ;)

-just a quick repeat. Camera.CFrame = Camera.CFrame * CFrame.Angles(0,math.rad(1),0)

Ad

Answer this question