Tween direction goes wierd

Its supposed to be a security camera system, but for some strange odd reason, it rotates fine the first few rotations, then it just starts rotating round and round.

CODE:

local function Loop(Camera)
	TweenService:Create(
		Camera.PrimaryPart,
		TweenInfo.new(6, Enum.EasingStyle.Sine),
		{CFrame = Camera.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(45), 0)}
	):Play()
	task.wait(10)
	while true do
		TweenService:Create(
			Camera.PrimaryPart,
			TweenInfo.new(6, Enum.EasingStyle.Sine),
			{CFrame = Camera.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(-90), 0)}
		):Play()
		task.wait(10)
		TweenService:Create(
			Camera.PrimaryPart,
			TweenInfo.new(6, Enum.EasingStyle.Sine),
			{CFrame = Camera.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(90), 0)}
		):Play()
	end
end

I missed out a task.wait(10) thats what caused the error.

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