Greetings, I have a simple aim system, M2 hold = aim in, M2 release = stop aiming
Currently, I have it so that it’s an instant snap, how would I go about making it smooth using lerp/tweens?
Code:
RunService.RenderStepped:Connect(function(DeltaTime)
if Aiming == true then
local Delta = UserInputService:GetMouseDelta()
local Direction = (Character.HumanoidRootPart.CFrame - Character.HumanoidRootPart.Position):Inverse() * Character.HumanoidRootPart.AssemblyLinearVelocity
SwaySpring:shove(Vector3.new(-Delta.X / 200, Delta.Y / 200, 0))
BobSpring:shove(Vector3.new(Bounce(2), Bounce(4), Bounce(2)) / 25 * (Character.PrimaryPart.Velocity.Magnitude) / 25)
Sway = SwaySpring:update(DeltaTime)
Bounce = BobSpring:update(DeltaTime)
Gun.Aim.CFrame = Camera.CFrame * CFrame.new(Sway.X, Sway.Y, 0) * CFrame.new(Bounce.X, Bounce.Y, 0) * CFrame.Angles(0,math.rad(-90),0)
end
end)