Hey, so I’m experiencing a weird thing with my script which has never happened to me before.

So, I’m trying to tween a rotation with CFrame.Angles, which I have done before, but now it just rotates everything and a sideways direction, even though only 1 direction was specified.

local TweenService = game:GetService("TweenService")
local rCog = workspace.RedCog
local gCog = workspace.GreenCog
local bCog = workspace.BlueCog
local tweenInfo = TweenInfo.new(
5,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out
)
local tweenRotationRed =
{CFrame = rCog.CFrame * CFrame.Angles(math.rad(180),0,0)}
local tweenRotationGreen =
{CFrame = gCog.CFrame * CFrame.Angles(math.rad(180),0,0)}
local tweenRotationBlue =
{CFrame = bCog.CFrame * CFrame.Angles(math.rad(180),0,0)}
local tween0 = TweenService:Create(rCog, tweenInfo, tweenRotationRed)
local function playGears ()
tween0:Play()
end
playGears()```
Any help will be much appreciated! <3

In studio, rotate the part around the axis you wish for it to rotate around and check the Origin Orientation property of the model in order to determine what values you need to use in order to tween the model’s orientation around the correct axis.

After typing this, I see you’re using BasePart instances and not models, in this case just do the same but check the Orientation property instead.

Yes, when you rotate the part manually in studio check how the “Orientation” property changes. If two of the components of its Vector3 value are changing then that will indicate that you will need to tween around two axis to achieve the desired rotation.

All 3 of them are changing, but I did notice if it’s 180 degrees as it is right now, the Orientation is just purely 180, 0, 0, like it is in the script, when I’m not changing anything else, I’m pretty confused but thanks for the tip.

Because all 3 components are changing you’ll need to multiply the CFrame value by: CFrame.Angles(math.rad(x), math.rad(y), math.rad(z))

Rotate the part in studio till you reach the desired goal, then just plug in the component values of its Orientation property into the above CFrame.Angles() call.