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

math.deg() or math.rad()?

Asked by 8 years ago
Torso.CFrame=Torso.CFrame*CFrame.Angles(math.deg(), math.deg(), math.deg())

I'm trying to make a player's character spin, and I'm not sure whether to use math.deg() or math.rad()

0
2pi radans = 360 degrees, or one whole spin. Maybe that will help a bit? SimplyRekt 413 — 8y
0
Still unclear to me, Kobertum -2 — 8y

2 answers

Log in to vote
0
Answered by
drahsid5 250 Moderation Voter
8 years ago

Math.rad turns a number into a radian, math.deg turns it into degrees. So if I wanted to rotate a brick by 45 degrees on the x axis I would do :

Brick.CFrame = Brick.CFrame*CFrame.Angles(math.rad(45),0,0)
0
Math.deg turns a radian into degrees, not "back into a number". Radians are numbers as well as degrees DigitalVeer 1473 — 8y
0
Idk what I was thinking. Thanks for noticing that! drahsid5 250 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

CFrame.Angles only accepts radians, so you would use math.rad to convert your degrees to radians

0
CFrame.Angles() will accept any number. CFrame.Angles(1,0,0) and CFrame.Angles(math.deg(.1),0,0) would both work. Radians are what you use to set it to a specific angle. drahsid5 250 — 8y

Answer this question