I’d probably use math.atan2 (atan2) on each of the components, but I have a suspicious feeling that this isn’t actually what you want. What are you going to use the orientation for?
the script uses :pivotTo on the workspace to rotate the workspace and i need to find the angle of a raycast result in vector3 to properly angle the player onto a surface.
Wouldn’t this
a) Cause a bunch of lag
b) Create a disconnect between the server and client
Apologies if I’m completely misinterpreting what you’re saying.
It would probably just be easier to use CFrame:ToWorldSpace() instead of going through all this vector stuff. You do have the part’s CFrame from the raycast, after all.