LookVector to Orientation

Hello.

I am looking for ways to convert the LookVector of a CFrame into a value that can inputted into a parts Orientation.

A look vector would look like:
-0.592781365, -0.50994271, 0.623352706
While a regular Vector3 orientation looks like:
-17.83, 45.23, 21.8

If you have a solution please let me know!

Apologies for any mistakes, I’m new to the dev forum.

I don’t know if this might work but the wiki page lists a method called toOrientation that returns a tuple of values that might represent the CFrame’s orientation.

If it works then be sure to remember to convert the angles to the right values, since a BasePart’s orientation property is shown in degrees, while CFrame operations typically require angles to be in radians.

1 Like
function lvToOrientation(lv)
	return Vector3.new(
		lv.X * lv.Z,
		lv.X * lv.Y,
		lv.Y * lv.Z
	)
end

sorry for replying so late LMAO

8 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.