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

How do you rotate a part 180 degrees?

Asked by
KoreanBBQ 301 Moderation Voter
9 years ago

I have a, let's say, part with a rotation of Vector3(0,41.5,0) and I want to rotate it 180 degrees on the Y axis. If I write 221.5 it doesn't work.

Do I have to add like Vector3.new(0,math.rad(180),0) or something? Help

1 answer

Log in to vote
3
Answered by 9 years ago

Do like this:

game.Workspace.Part.CFrame = game.Workspace.Part.CFrame * CFrame.Angles(0,math.rad(180),0)

Also, you don't use math.rad in Vector3, math.rad Translates in Radians, Vector3 is in radians already.

0
I tried *CFrame.Angles(0,math.pi,0) (same thing) but didn't work KoreanBBQ 301 — 9y
0
AH CHANGED IT TO MATH.RAD(90 AND IT WORKED) KoreanBBQ 301 — 9y
Ad

Answer this question