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

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

Asked by
kazeks123 195
6 years ago

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

Log in to vote
0
Answered by 6 years ago

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

0
Not a tutorial on how to get part's roation around a specific vector, but it will do kazeks123 195 — 6y
Ad

Answer this question