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

1. How do you rotate a part 90 degrees?

Hi, scripter newbie here. I was wondering how you rotate a part 90 degrees, no matter what position it is in. Could someone assist me?

Thanks!

1 answer

The best way to rotate a part would be with CFrame, setting the position of the part if it is inside/partially inside another part will cause it to find the next available spot on the y-axis.

To rotate with CFrame you would do something like:

part.CFrame = part.CFrame * CFrame.Angles(math.rad(90),0,0)

The math.rad will convert it from degrees to radians which CFrame uses

5 comments

0

You could use the orientation property.

0

bad idea to use Orientation property

0

um..., you don't even need a script. Can't you just use the rotate tool...

0

I have a question why did u put 2 perentices around the 90

0

rad is a function of math so we reference it through math.rad and since it is a function, we need to use parenthesis to pass arguments to it

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