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

What's wrong with this?

I'm trying to make the rotation of something (90,0,0) and I can't use Part.Rotation so when I do this it makes the rotation 116.62 instead of 90 why won't it make the rotation 90?

part.CFrame=part.CFrame*CFrame.fromEulerAnglesXYZ(90,0,0)

1 answer

✓ Accepted answer

Use CFrame.Angles instead, it's the same method, but with a shorter name.


CFrame.Angles uses radians, not degrees. There are 2 pi (apprx. 6.28) radians in a full revolution (as opposed to 360 degrees).

The reason for this comes from math. Using radians makes calculus much neater (e.g., d/dx sinx(x) = cos(x)) and makes other identities nice (e^(i * x) = cos(x) + i * sin(x))

You can convert between radians and degrees using math.deg and math.rad, e.g.,

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

which happens to be * CFrame.Angles( math.pi / 2, 0, 0).

2 comments

0

Wow, I feel like this is a question I answered a while ago. I don't know if it's the same asker or not. xD

0

It's not

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