In your code both your goal variables are being set twice for no reason
local goal1 = script.Parent.Parent.main1 -- This is never used
local goal1 = {} -- This overwrites the "main1" instance, you also don't need the "local" here
I’m not sure what you mean by the part isn’t moving, it’s position and rotation are changing in the video, but if I understand correctly they aren’t moving the way you want them to.
I would suggest setting your goal’s CFrame using the transparent part’s CFrame, that would be easiest.
local TweenService = game:GetService("TweenService")
local model = script.Parent
while true do
TweenService:Create(model.Main, TweenInfo.new(2), {Position = model.Goal1.Position}):Play()
task.wait(2)
TweenService:Create(model.Main, TweenInfo.new(2), {Position = model.Goal2.Position}):Play()
task.wait(2)
end
Edit: Further optimized the code to be smaller.
Btw you don’t even need CFrame for this. You could just use position unless your gonna do some angle stuff later.
Like @MrLonely1221 Said you could replace the CFrame values with the two parts positions.
So why are you referencing the two parts and then not using them? You could just move and position those so that it goes from the CFrame of one, to the CFrame of the other.