Hello, i have a sprint script and a idle camera movement where in studio the settings work accordantly, but when i test in actual game the players walk speed tween to max speed gets increased and the Stamina bar goes down faster, and my idle breath moves 2x faster in game rather than studio, Any reason Why?
Studio
Are you using task.wait() or wait() for each time the stamina bar drains? If so, then the cause is FPS/a FPS unlocker. Players with higher FPS run task.wait() or wait() faster/more often than those with lower FPS. Your Roblox Studio could be running at 60 FPS while in-game you’re using a FPS unlocker which makes it drain much faster. Other than this possibility, I don’t know why it could be doing that.
local lspeed = 0.01
local function lerp(s,e,a) return s+(e-s)*a end
local ix = 0
local iy = 0
local pi,sin,pi2 = math.pi,math.sin,math.pi*2
local cam = workspace.CurrentCamera
local lsx,lx,lsy,ly = speedx/1000,x/1000,speedy/1000,y/1000
game:GetService("RunService"):BindToRenderStep("Swaying",201,function()
if game.Players.LocalPlayer.Character:WaitForChild("Humanoid").MoveDirection.Magnitude == 0 then -- we are idle
lsx=lerp(lsx,speedx/1000,lspeed)
lx=lerp(lx,x/1000,lspeed)
lsy=lerp(lsy,speedy/1000,lspeed)
ly=lerp(ly,y/1000,lspeed)
ix = (ix + lsx)%pi2
iy = (iy + lsy)%pi2
cam.CFrame = cam.CFrame * CFrame.Angles(sin(ix)*lx,sin(iy)*ly,0)
end
end)```
Oh, RenderStep means every time that things are being rendered meaning that this is FPS dependent as well. You should be able to fix this by using tweenservice to tween the camera instead