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

How to make a brick move smoothly from one position to another?

I tried this,

Part.CFrame = CFrame.new(104.9, 0.5, 1.24)

but the part instantly moves to that position, and does not move smoothly there. Any help/advice?

4 comments

0

Where does the part start?

1

0,0,0

0

I want it to move smoothly to 104.9, 0.5, 1.24, not instantly

0

for i = 0, 1, 0.01 do part.CFrame = CFrame.new( part.Position:Lerp(stop.p * multiplier, i) ) script.Parent.Parent.Doorend.CFrame = CFrame.new(script.Parent.Parent.Doorend.Position:Lerp(CFrame.new(60.35, 3.85, 71.2).p*multiplier,i) )wait() end

2 answers

✓ Accepted answer

try lerp()

Edit*

This guy made a tutorial on how to do it. Yes it's camera manipulation but you can change it up

Here

5 comments

0

This is also a good way of doing it

0

how to lerp?

0

ummm pretty much do a

0

do a?

0

I edited the post so watch the video

CFrame stands for CoordinateFrame. You set the part's CoordinateFrame (read position) to a new CoordinateFrame.

Try changing the part's CFrame over time;

-- move from (0, 0, 0) to (104.9, 0.5, 1.24) over 50 iterations
Part.CFrame = CFrame.new(0, 0, 0);

for a = 1, 50 do
	-- add how far we want to move each step to where we are at each step
	Part.CFrame = Part.CFrame * CFrame.new(2.090, 0.001, 0.0248);
	print(Part.CFrame);
	wait();
end

2 comments

0

But it move's there instantly, I want it to move smoothly from 0,0,0 to 104.9, 0.5, 1.24

0

Sorry, add a wait() into the for loop.

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