So I've been trying to make a script that rotates a ring into a perfectly flat, horizontal position when a button is pressed, but i don't think I understand how rotation works. For example, when I apply this line of code:
while true do
wait()
script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0,math.rad(math.pi*2),0)
end
It rotates the ring along the X- Axis by ~ 6.283 each pass ( approximately pi*2), but this only works when the ring starts at a rotation of X:90 Y:0 Z:90. If i rotate it to some weird rotation, say, X:114.838 Y:58.825 Z:50.398, all three coordinates are altered when the script runs, instead of just the X coordinate as seen earlier. Can someone explain why this happens?
Also, when running the script at rotation X:90 Y:0 Z:90, the Y coordinate fluctuates between 0 and -0. Not sure if this is significant, but I thought it'd be worth mentioning.
I have read the ROBLOX Wiki page on CFrame, but I still don't quite understand it :/

1 comment
The code that you gave me didnt quite do what I needed, but your comment on sticking a rod into a ball gave me a lead on this question. Thanks!