I am making an fps but my aim is super snappy and I can’t figure out how to tween a moving object to another moving object.
RunService.RenderStepped:Connect(function(step)
local shirt = game.Players.LocalPlayer.Character:FindFirstChild("Shirt")
if shirt then
script.Parent["Left Arm"].Decal.Texture = shirt.ShirtTemplate
script.Parent["Right Arm"].Decal.Texture = shirt.ShirtTemplate
end
script.Parent:WaitForChild("AmmoShow").SurfaceGui.Frame.Ammo.Text = script.Parent.Server.Ammo.Value
script.Parent:WaitForChild("AmmoShow").SurfaceGui.AlwaysOnTop = true
if aim == false then
local camframe = game:GetService("Workspace").CurrentCamera.CFrame
script.Parent.FakeCamera.CFrame = camframe + camframe.LookVector * -0 + camframe.UpVector * -0 + camframe.RightVector * -0
local rotation = workspace.CurrentCamera.CFrame:toObjectSpace(lastCameraCF)
local x,y,z = rotation:ToOrientation()
swayOffset = swayOffset:Lerp(CFrame.Angles(math.sin(x)*mult,math.sin(y)*mult,0), 0.1)
script.Parent.FakeCamera.CFrame = script.Parent.FakeCamera.CFrame * swayOffset
lastCameraCF = workspace.CurrentCamera.CFrame
else
local camframe = game:GetService("Workspace").CurrentCamera.CFrame
script.Parent.Aim.CFrame = camframe + camframe.UpVector * -0.03
local rotation = workspace.CurrentCamera.CFrame:toObjectSpace(lastCameraCF)
local x,y,z = rotation:ToOrientation()
swayOffset = swayOffset:Lerp(CFrame.Angles(math.sin(x)*mult,math.sin(y)*mult,0), 0.1)
script.Parent.Aim.CFrame = script.Parent.Aim.CFrame * swayOffset
lastCameraCF = workspace.CurrentCamera.CFrame
end
end)