Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you "smoothly" change a parts position from one point to another?

I'm using camera manipulation and the camera is on a part. I want the block to move smoothly from point A to point B where there are no skips or signs of "choppyness"

Help Please?

1 comment

0

Try using a for loop to CFrame the part gradually to it's desired position.

1 answer

✓ Accepted answer

The only way to "remove" choppyness is to have the program running on your computer. If it runs on the server then there will be a network delay. If its physics network ownership is on someone else's computer then there will be two network delays plus however bad their computer might be.

If it's just running on your computer then interpolating CFrames would be fine:

local velocity=50
local c1=CFrame.new()
local c2=CFrame.new(10,10,10)

local stepped=game:GetService("RunService").RenderStepped
for i=0,1,(c1.p-c2.p).magnitude/(velocity*60) do
	Part.CFrame=c1:lerp(c2,i)
	stepped:wait()
end

1 comment

0

Thanks man!

This discussion is preserved as it was. New answers, comments, and votes are closed.