Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

3 comments

1

Camera.CFrame = Camera.CFrame * CFrame.Angles(0,math.rad(1),0)

2

Also, its called Recoil, not 'Jerk effect'

0

Thank you...

1 answer

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.