Hey guys i'm wanting to move a brick to the postion of another brick smoothly and gradually, i have created the function below to do this.
The issue with it is that the time it takes to move the brick to the other brick always remains the same because of how low wait() gets and roblox cannot wait with such accuracy and it is rounded to 0.
How do you guys suggest i make this work without making the brick movement seem jumpy, by altering the 0.1.
Thanks for any and all suggestions!
local function move(part,point,speed)
local distance = (point-part.Position).Magnitude
local waitTime = distance/speed
local direction = CFrame.new(part.Position, point).lookVector
for i = 1, distance, 0.1 do
part.Position = part.Position + (direction * 0.1)
wait((waitTime/distance) * 0.1)
end
end
move(script.Parent, workspace.End.Position, 10)

3 comments
Even after fixing your code, this is too fast and if i increase the wait its too jumpy.
Oh, I see. I forgot the 'do' keyword. Yeah, I often do that mistake. Plus, I was kind of in a rush. Updated my answer.
For an even smoother transition, you can also lower the third value of the 'for' loop.