Get Orientation from Position that is moving to

Hi so i made a script which tweens the position to childrens of a folder.
I want to make the part face toward the direction its going to, i dont know if this is clear enough but heres a video of what it looks like right now.

And as you see the rootPart of the bot(the part that makes the bot moves) is only facing one direction.

--> Gets robot's Y Position
local currentYPos = {}
if not table.find(currentYPos, script.Parent.RootPart) then
	currentYPos[script.Parent.RootPart] = script.Parent.RootPart.Position.Y
local yPos = currentYPos[script.Parent.RootPart]
local addY =,yPos,0)

--> General tween settings
local tweenService = game:GetService("TweenService")
local instance = script.Parent.PrimaryPart
local tweenInfo =

--> Applys tweens
local folder = workspace.Folder
for i,v in pairs(folder:GetChildren()) do
	if v then
		local goals = {}
		local goal = {Position = v.Position + addY}
		table.insert(goals, goal)
		for i = 1, #goals do
			local tween = tweenService:Create(instance, tweenInfo, goals[i])

For applying both position and orientation/rotation, you should use CFrames, which handle both position and rotation. For your purpose, your goal could be local goal = {CFrame = v.CFrame + addY}, which will take the CFrame of v and apply your Y offset.

If CFrames are new to you, I’d heavily recommend checking out the Understanding CFrames article on the Roblox DevHub as they are a more advanced concept. It includes examples of CFrames being used, as well as how to properly use them in your game.