How to make tool following camera smoother

So, I’m making an fps game, and I want the tool to follow the player’s camera. I ended up coming across this post by EgoMoose. However, this is hard for me to follow as I have near no knowledge of this stuff. Then, I found this on scriptinghelpers.org https://gyazo.com/abd706d0ec52b4cc80788554fac5b9cc
It is simpler, I can follow it better. Thing is, it is VERY choppy. https://gyazo.com/404939d9f69fd1a8ca34fcd93cae5689
Is there a way to make it smoother? Is there a better method without using ViewModel? If there is no way without using ViewModel, is there a simpler ViewModel method?

Here is the script off of scripting helpers (Note: This is for r6 and the weapon has no handle because I followed headstackk’s animation tutorial.):

plr = game.Players.LocalPlayer; -- local script
repeat wait() until plr.Character
char = plr.Character
m = plr:GetMouse()
game["Run Service"].RenderStepped:connect(function()
    local c = game.Workspace.CurrentCamera

    char.HumanoidRootPart["RootJoint"].C0 = CFrame.new(0,0,0) * CFrame.Angles(-math.asin((m.Origin.p - m.Hit.p).unit.y) + 1.55,3.15,0)

    char.Humanoid.CameraOffset = (char.HumanoidRootPart.CFrame+Vector3.new(0,0,0)):pointToObjectSpace(char.Head.CFrame.p + Vector3.new(0,-1.46,0))

end)
1 Like

WOW, such a long time and no one helped you? o.O rip lol

try this

plr = game.Players.LocalPlayer -- local script
repeat wait() until plr.Character
char = plr.Character
m = plr:GetMouse()
game["Run Service"].RenderStepped:connect(function()
	local c = game.Workspace.CurrentCamera
	char.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(-math.asin((m.Origin.p - m.Hit.p).unit.y),1.55,0)
	char.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(-math.asin((m.Origin.p - m.Hit.p).unit.y),-1.55,0)
	char.Torso["Neck"].C0 = CFrame.new(0,1,0) * CFrame.Angles(-math.asin((m.Origin.p - m.Hit.p).unit.y) + 1.55,3.15,0)
end)

and yes, its for r6

1 Like

yo is there one for R15? trying to find one but cant find any

This was the best solution I found that was simple to follow:

local plr = game.Players.LocalPlayer
repeat wait() until plr.Character
local char = plr.Character
local rootJoint = char:WaitForChild(“HumanoidRootPart”)
local camera = workspace.CurrentCamera
local camCf = camera.CFrame
local rot = CFrame.new(camera.CFrame.p)
local angle = 0
local m = plr:GetMouse()

game:GetService(“RunService”).RenderStepped:connect(function()
if game.Players.LocalPlayer.Character.Humanoid.Sit then return end

angle = angle + m.Delta.X*0.05
camCf = rot * CFrame.Angles(0, angle, 0)

camCf = camCf * CFrame.new(0, -1.5, 4)
camCf = camCf * CFrame.Angles(-math.asin((m.Origin.y - m.Hit.y).unit.y) + 1.55, 0, 0)
camera.CFrame = camCf

end)

I just added the script to the LocalScript, and I was good to go!

your reply seems to control the camera via mouse. and he needed a way to control tool via mouse :confused: