When I set the CFrame rotation of a Part using multiple axes, the part rotates in a strange way.
This Part, called TestBlock, is rotated to an x-angle of -15 degrees (which is converted to radians for CFrame.Angles().). I expect that, if I also rotate the TestBlock on the Y-axis, the part will still be rotated on the X-axis. I believe this because I can set the desired rotation in Studio, as shown in this image. I can set the rotation to (-15, 90, 0) (XYZ order) directly in Studio.
But when I use CFrame.Angles() to rotate the TestBlock in the Y-axis as well, the part also rotates on the X-axis. This is demonstrated in the Properties section of the TestBlock, as the X-value does not remain at the desired X-axis value of -15 degrees.
To rotate the TestBlock as shown in the above video, I’m using the following code.
--- Rotate the block arond the Y-axis
local block = workspace.TestBlock
local counter = 0
while task.wait(1) do
block.CFrame = CFrame.Angles(math.rad(-15),math.rad(counter),0)
counter += 45
end
I’m expecting that if CFrame.Angles() is given an X-value of -15, a Y-value of counter, and a Z-value of 0, the Part’s X-value will be -15, the Y-value will be equal to counter, and the Z-value will be equal to 0. But the video shows that doesn’t happen, which is why I’m confused.
I’m not setting the rotation directly using a Vector3 value, as I need to use CFrames to rotate models and cameras. I’m using a Part to show the unexpected rotational behavior.
What am I missing? Thank you for any help!



