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

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

Asked by 5 years ago
Edited by User#24403 5 years ago

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

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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)
0
Oh yeah forgot about that thanks MysticalNinja12345 4 — 5y
Ad

Answer this question