so I have this script that uses lerp to change shoulders smoothly, it works but he FPS drops a lot, I have been told this is because I use wait() and not delta time but I have no clue how to use delta time and need some help, anything is appreciated, the script below: (sorry for such a messy script)
local Dbounce = false
local function inputBegan(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.T then
if not gameProcessedEvent then
if Dbounce == false then
Dbounce = true
if isRight == true then
isBeingChanged = true
for i = 0,1, .01 do
cameraOffset = cameraOffset:Lerp(cameraOffset2, i)
wait()
end
isRight = false
else
for i = 0,1, .01 do
cameraOffset = cameraOffset:Lerp(OGcameraOffset, i)
wait()
end
isRight = true
end
wait(1)
Dbounce = false
end
end
end
end
end
UserInput.InputBegan:Connect(inputBegan)