so i need to move one part to another but not instantly i was trying
for i = 1,10 do
part1.CFrame = (Part1.CFrame - Part2.CFrame)/10
end
doesn't work :/ anybody got suggestions 4 me?
so i need to move one part to another but not instantly i was trying
for i = 1,10 do
part1.CFrame = (Part1.CFrame - Part2.CFrame)/10
end
doesn't work :/ anybody got suggestions 4 me?
Lerping is a great option for that:
for i = 1,10 do
part1.CFrame = part1.CFrame:Lerp(Part2.CFrame, i/10)
wait() -- Don't forget the wait()!
end
Lerping is basically an easier and a simplier way to tween
https://developer.roblox.com/en-us/api-reference/datatype/CFrame (You can find lerp in the properties > functions)
Hope it helped!
Make sure the part1 is anchored
Wow that is so cool I had no idea that existed thanks!
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
use lerp or interpolation