Tween is giving my part strange orientations

The script I have right now is just cycling through three different camera positions for test purposes before I add real functionality, but so far the tweens are adding an unwanted Z value and variations to my orientation. I’ve tried using math.rad() and using different methods of setting up the dictionary (such as using CFrame.Angles), but the issue persists. Pos2 was the only position with the correct orientation (-15, 0, 0).

local cam = workspace.CurrentCamera
local camPart = workspace.CamPart
local rs = game:GetService("RunService")
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)

local pos1 = {
	Position = Vector3.new(10.5, 5.5, -24.5),
	Rotation = Vector3.new(-10, 40, 0)
}
local pos2 = {
	Position = Vector3.new(11.75, 5.5, -26.5),
	Rotation = Vector3.new(-15, 0, 0)
}
local pos3 = {
	Position = Vector3.new(13, 5.5, -25),
	Rotation = Vector3.new(-10, -80, 0)
}

cam.CameraType = Enum.CameraType.Scriptable

rs.RenderStepped:Connect(function()
	cam.CFrame = camPart.CFrame	
end)

while true do
	local tween = ts:Create(camPart, ti, pos1)
	tween:Play()
	wait(3)
	local tween = ts:Create(camPart, ti, pos2)
	tween:Play()
	wait(3)
	local tween = ts:Create(camPart, ti, pos3)
	tween:Play()
	wait(3)
	local tween = ts:Create(camPart, ti, pos2)
	tween:Play()
	wait(3)
end

Screenshot 2023-12-18 230103
The orientation of Pos1 after tweening.

Screenshot 2023-12-18 230045
The orientation of Pos3 after tweening.

Is your part anchored? If its not it will be affected by gravity even when its tweening.

Yes, I have made sure it was anchored :+1:

I see you are tweening to Pos2 twice. Once after tweening to Pos1 and after Pos3. Do both Pos2 tweens give the correct orientation?

I tried it on my system and by individually tweening ( not in sucession ) im getting the desired orientation.

I think u should try and debug if the tween is getting completed by listening to the event and printing. In succession i think the tweens are not completed and in the wait sequence they are overlapped. Its seems weird to me because ur tween time is less than the wait.

Rotation and Orientation are not quite the same properties. The application order of X, Y, and Z rotations differs between the two, which makes them different values, equal only sometimes, mostly when the object is rotated around a single axis.

For more detailed explanation, I recommend taking a look at Elttob’s answers in this discussion.

Having that said, the part’s rotation is correct, as evident from printing the value after tweening.


For simplicity, consider representing position and orientation as parts and their CFrames. Make sure that they are facing the focus point (with their z-axis), and then align the camera’s CFrame with the part’s CFrame.

Instead of aligning camera with CamPart, you could as well update camera’s CFrame directly.

Yes, both Pos2 tweens are working fine. I’ve since edited the script to now tween according to an input from a GUI (an image button arrow on each side of the screen), and still the same issue.

Swapping Rotation with Orientation did the trick, thank you!

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