Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I rotate a part using CFrame?

Asked by
Minifig77 190
10 years ago

I'm trying to make a constantly spinning part, and I need to rotate it with CFrame. How do I do this? (I don't understand Euler angles at all.)

1 answer

Log in to vote
1
Answered by 10 years ago
while true do
    script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0.05,0.05,0.05)
    wait(0.01)
end

Put that in a script and insert the script into the part you wish to rotate. The part will rotate in 3 directions at once at a moderate speed. To increase the speed, slightly increase the values after ' CFrame.fromEulerAnglesXYZ'. To stop a rotation in one of the directions, erase the corresponding part of the value, such as putting (0.05,0.05,0.00) will make it spin in two directions instead of three.

I hope this helped!

Ad

Answer this question