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

How to get a part's angle on a given vector?

Basically what I'm asking is how to get local rotation (specific angle) of a part. Imagine it like a reverse action of CFrame.Angles

So far I know, that CFrame.lookVector will return the local Z axis of a part and that the CFrame.rightVector will return the local X axis, but what about part's rotation (angle) around this axis?

CFrame:toEulerXYZ will return correct value until the part is rotated along the Y axis, then the value becomes incorrect.

I know that this is possible becuase roblox studio's rotation tool always displays rotation axes relative to the part not the world.

1 answer

✓ Accepted answer

For a BasePart its .Rotation property will return its local rotational values in degrees.

1 comment

0

Not a tutorial on how to get part's roation around a specific vector, but it will do

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