Hello, I am trying to make a part move up and down at the same speed for all players, but this localscript makes it so that it changes speed depending on the fps, slower fps makes it slower and faster fps makes it faster.
local RunService = game:GetService("RunService") local part = workspace:WaitForChild("LollipopUnion2") local loopNumber = 200 local length = 50 while true do for i = 0, loopNumber, 1 do part.Position = part.Position + Vector3.new(0, length / loopNumber, 0) RunService.Stepped:Wait() end for i = 0, loopNumber, 1 do part.Position = part.Position - Vector3.new( 0, length / loopNumber, 0) RunService.Stepped:Wait() end end
The reason for the change in speed is the frame rate.
RunService.Stepped has a parameter that defines the time since the last time the event was fired.
deltaTime
double
The time (in seconds) that has elapsed since the previous frame
If the player has a lower frame rate, the part will move slower for them.
If you need more help, contact me on Discord (phxntxsmic#2021)
If you're doing it for the whole server, wouldn't you do a ServerScript? And it's probaby because of lag, lower FPS is more lag so it might go slower