Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would i rotate a part by cframe without looking like this?

So I have a script to make a box with parts and for some reason it doesn't wanna rotate correctly with CFrame.Angles. It Instead does this

Picture

Code:

Part.CFrame = Part.CFrame * CFrame.new(0,-i + #Matrix + 3,b + 2) * CFrame.Angles(0,90,0)

Edit; use [text](url) for links

1 answer

✓ Accepted answer

Angles takes radians, and not degrees. You can convert degrees to radians with the math.rad function:

CFrame.Angles(0, math.rad(90), 0)

But this can be simplified. Remember that pi radians is 180 degrees so pi/2 radians is 90 degrees:

CFrame.Angles(0, math.pi/2, 0)

1 comment

0

Oh yeah forgot about that thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.