i have fireballs that i made this is the script that makes it move
local part = script.Parent
while true do
part.CFrame = part.CFrame + part.CFrame.LookVector
task.wait()
end
i have fireballs that i made this is the script that makes it move
local part = script.Parent
while true do
part.CFrame = part.CFrame + part.CFrame.LookVector
task.wait()
end
This is likely because you are running your game at an fps higher than 60 fps, and when doing a local test in studio, the client and the server both run at the target fps you’ve set in the settings (I assume you set it above 60 fps), which is a bit annoying…
Roblox servers in game always run at 60 fps (unless they are lagging)
task.wait(), when it has no argument, runs on every frame, so at 60 fps it will run 60 times per second, and at 120, it’ll run 120 times per second
You should probably take deltatime into a count when updating your part’s position:
local part = script.Parent
while true do
local dt = task.wait()
part.CFrame = part.CFrame + part.CFrame.LookVector * dt * 60
end
DeltaTime is the amount of time from the last frame to the current frame. By doing so, the distance is adjusted by the time difference between frames, which will lead to a more consistent movement
i never knew such thing like that
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.