local RunService = game:GetService("RunService") local part = game.workspace:WaitForChild("Start") local part1 = game.workspace:WaitForChild("Finish") local PART1_POS = part1.position local PART_POS = part.position local DURATION = 5 RunService.RenderStepped:Connect(function() local deg = 0*(wait(10) % DURATION)/ DURATION part.CFrame = CFrame.new(PART1_POS) * CFrame.Angles(0,0,(deg),0) * CFrame.new(PART_POS) end)
That is what I have so far, but whenever i try it the part moves instantly, it does not move smoothly to the other part? How do you fix this?
The best way to do this would be to use TweenService.
Essentially, use the TweenInfo.new
function to declare the speed of the tween.
Use the TweenService:Create()
method to create the tween.
And finally, use the Play
function to play the tween.
local TweenService = game:GetService("TweenService") local part = workspace:WaitForChild("Start") local part1 = workspace:WaitForChild("Finish") local tweenInfo = TweenInfo.new(5) --5 Seconds local goal = {}; goal.CFrame = part1.CFrame; --Make the goal's CF part1's CF local tween = TweenService:Create(part, tweenInfo, goal) tween:Play()