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?
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?
try lerp()
Edit*
This guy made a tutorial on how to do it. Yes it's camera manipulation but you can change it up
This is also a good way of doing it
how to lerp?
ummm pretty much do a
do a?
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
But it move's there instantly, I want it to move smoothly from 0,0,0 to 104.9, 0.5, 1.24
Sorry, add a wait() into the for loop.
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
Where does the part start?
0,0,0
I want it to move smoothly to 104.9, 0.5, 1.24, not instantly
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