Hello, my sprint script causes the camera’s fov to “pulse”, and I’m not sure how to fix it.
local player = game.Players.LocalPlayer
repeat task.wait() until player.Character
local camera = workspace.CurrentCamera
local humanoid = player.Character.Humanoid
local UIS = game:GetService("UserInputService")
local debounce = false
local isRunning = false
UIS.InputBegan:Connect(function(input, isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.LeftShift then
if not debounce then
debounce = true
isRunning = true
task.wait(4)
debounce = false
end
end
end)
UIS.InputEnded:Connect(function(input, isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.LeftShift then
isRunning = false
end
end)
while true do
print(humanoid.WalkSpeed)
if isRunning == true then
for i = 70,85,1 do
camera.FieldOfView = i
humanoid.WalkSpeed = 25
task.wait(0.01)
end
else
for i = 85,70,-1 do
camera.FieldOfView = i
humanoid.WalkSpeed = 16
task.wait(0.01)
end
end
task.wait()
end