I have seen people using CFrames to move an object to another objects position but actually having it move and not just teleport. I was wondering how this works. You can see it is used here.
Using CFrame to move an object to a position?
2 answers
Use TweenService! Tweening is used for interpolating almost any numeric property of certain objects. In your case, I'm assuming, a part.
So here's how it goes;
local TweenService = game:GetService("TweenService") --gets tween service
local part = workspace.Part --gets the part (change it to your own part's address)
local tweenInfo = TweenInfo.new( --how we want our tween to play
1, --how fast the tween is (in seconds)
Enum.EasingStyle.Linear, --easing style
Enum.EasingDirection.Out, --easing direction
0, --no. of times the tween will repeat
false, --will the tween reverse upon finishing?
0 --how long the delay is (in seconds)
)
local goal = { --goal for our part's property, in this case, the position
Position = Vector3.new(69,42,0) --our goal position for our part
}
local tween = TweenService:Create(part, tweenInfo, goal) --now creates the tween
tween:Play() --finally, plays it
Here are some resources; I hope this helps! https://developer.roblox.com/en-us/api-reference/class/TweenService https://developer.roblox.com/en-us/api-reference/datatype/TweenInfo https://developer.roblox.com/en-us/api-reference/enum/EasingStyle
2 comments
Dr_Smartypants123's lerp method works too but I feel tweening is a bit easier to manipulate.
Also, how would I add orientation to this?
You can use https://developer.roblox.com/en-us/api-reference/class/TweenService or https://devforum.roblox.com/t/cframe-lerping-with-for-loop/1104800
1 comment
Thanks! Works great :)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
You can use TweenService if you want to move parts.