CFrame only changing once in a tween loop

I’m Trying to make a script that tweens the rotation of a part in a loop so it goes in a circle but it only changes once and I know the Tween is playing again because I used printing to see if it played multiple times and it did.
Can someone help me with it and tell me what did I do wrong because I feel like I’m missing a small detail and I’ve been trying to fix this for almost 20 minutes:

wait(5)

local part = script.Parent
local Tweenservice = game:GetService("TweenService")
local InitialFrame = part.CFrame


local info = TweenInfo.new(
	.5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

local Endpoint = {
	CFrame = part.CFrame * CFrame.Angles(0, math.rad(60), 0)
}


local Tween1 = Tweenservice:Create(part,info, Endpoint)

while true do 
	print(part.CFrame)
	Tween1:Play()
	print("tween play")
	Tween1.Completed:Wait()
	print("Tween done")
	
	
end

You forgot to put your goal and tween inside the same loop, and it’s just reading the same value.

while true do 
  local Endpoint = {CFrame = part.CFrame * CFrame.Angles(0, math.rad(60), 0)}
  local Tween1 = Tweenservice:Create(part,info, Endpoint)
	print(part.CFrame)
	Tween1:Play()
	print("tween play")
	Tween1.Completed:Wait()
	print("Tween done")
end
1 Like

Thank you so much, I’ve been trying to fix this for a while :white_check_mark:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.