What I am trying to achieve?
I want to turn a part to Mouse.Hit.Orientation.Y (Yes thats doesn’t exist)
What is my issue?
I don’t know how to get the orientation of a cframe
What solutions have I tried so far?
cframe:ToOrientation returns a number value and Idk how to fix it.
3 Likes
CFrame:ToOrientation()
returns the approximate X,Y,Z Euler angles of the given CFrame in RADIANS. You simply need to convert the Y-orientation (the one you’re looking for) to degrees by using math.deg()
.
local x,y,z = myCFrame:ToOrientation();
local realY = math.deg(y);
13 Likes
Also, you can do a simple Ctrl + F search for this on the CFrame documentation.
Documentation is a powerful tool.
Thank you! That did exactly what I needed!
Mhmm, no problem!
Just came here after 2 years to say that the documentation doesn’t specify the value is returned in radians.
The documentation is unfinished.
7 Likes