So i have an anochored part that i want to move to a direction.
like:
while task.wait() do
script.Parent.CFrame = CFrame.new(script.Parent.Position + script.Parent.CFrame.LookVector)
end
but people with lower fps will experience slower bullet. so how would i control the speed of the bullet to be as the desired speed as i want and how would i make it run the same for everyone?
You need to use the DeltaTime. Right now i’m on phone it’s difficult to modify the script but someone will do it, or just look on the devforum how to add the DeltaTime (dt)
while true do
local _,currentTime = wait()
local dt = currentTime-lastTick
print(dt)
lastTick = currentTime
script.Parent.CFrame = CFrame.new(script.Parent.Position + script.Parent.CFrame.LookVector*dt)
end