Hey, so I’ve run into a minor issue with a loop where I move npcs forward on the server in a heartbeat loop, so there is a finish line and i start a timer from the start point and on studio they are visibly faster the when i run it in game and also there times when im in studio are always below 10 seconds, but in game they never go below 10, and I haven’t changd the scripts or anything
The decelerate is just a function from a module that graually reduces the humanoid’s walkspeed
The HeartBeat function could be slowing it down because it is happening last in the loading sequence so maybe try stepped (Middle loaded) or renderstepped (First loaded).
So what could I do about it or is there nothing I can do?
Also this is the timer if this even helps
local startTime = os.clock()
local prevTime = startTime
while self.timer do
local currentTime = os.clock()
local deltaTime = currentTime - prevTime
self.elapsedTime += deltaTime
RemoteManager.Timer:FireAllClients(self.elapsedTime)
if self.elapsedTime > self.maxEventTime then
RemoteManager.TimerEnd:FireAllClients()
self:RemoveCurrentHeat()
self:ResetTimer()
break
end
prevTime = currentTime
task.wait(0.01)
end
When running in Studio, you are running on your Computer, rather than a Roblox Server, however in Game, you are connecting to Roblox’s actual Servers, which depending on your connection, can be delayed (typically applies to Server)
Yeah but I was in a server with just me in that would mean I would get the best ping and all that stuff, so is this just something I have to deal with?
With the Server, it would have to be something that you would need to deal with.
If you create the Server (on actual Roblox Servers), it will be based around your location, but if your connection is still bad, it will still cause latency.
Edit: You can probably have “synchronize” the Client and Server