local player = game.Players.LocalPlayer local mouse = player:GetMouse() local camera = workspace.CurrentCamera mouse.Button2Down:Connect(function() for i = 1, 10 do wait() camera.FieldOfView = camera.FieldOfView - 3 end end) mouse.Button2Up:Connect(function() for i = 1,10 do wait() camera.FieldOfView = camera.FieldOfView + 3 end end)
Basically, spamming the left button on your mouse makes the animation glitch out a bit when zooming in and out, anyone know how to counter this? I tried with a wait loop but it does not work.
Use Debounce. It helps prevent spamming in your functions. https://developer.roblox.com/articles/Debounce