Hello, I have this problem where Gun recoil is bit janky and Stuttering when Humanoid is moving.
Video :
localScript :
local Camera = game.Workspace.CurrentCamera
local TweenService = game:GetService("TweenService")
local Debounce = false
script.Parent.Activated:Connect(function()
if Debounce == false then
local CameraCframe = Camera
CameraCframe.CFrame = Camera.CFrame
local E = {}
E.CFrame = Camera.CFrame * CFrame.Angles(math.rad(math.random(-0.05, 0.3)), math.rad(math.random(0.1, 3)), math.rad(math.random(-0.05, 0.3)))
local G = {}
G.CFrame = Camera.CFrame + Vector3.new(0, 0, 0)
local CameraTweenFirst = TweenService:Create(Camera, TweenInfo.new(0.12), E)
CameraTweenFirst:Play()
Debounce = true
task.wait(0.3)
local CameraTweenlast = TweenService:Create(Camera, TweenInfo.new(0.12), G)
CameraTweenlast:Play()
Debounce = false
local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
if Humanoid.Running or Humanoid.Walking then
CameraTweenFirst:Cancel()
CameraTweenlast:Cancel()
end
end
Is there anyways to fix this issue?