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

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

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()

2 comments

0

2pi radans = 360 degrees, or one whole spin. Maybe that will help a bit?

0

Still unclear to me,

2 answers

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)

2 comments

0

Math.deg turns a radian into degrees, not "back into a number". Radians are numbers as well as degrees

0

Idk what I was thinking. Thanks for noticing that!

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

1 comment

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.

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