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!
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!
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
This discussion is preserved as it was. New answers, comments, and votes are closed.
5 comments
You could use the orientation property.
bad idea to use Orientation property
um..., you don't even need a script. Can't you just use the rotate tool...
I have a question why did u put 2 perentices around the 90
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