So I'm trying to make one part face another, I can do it with Roblox inbuilt functions but when I do the math myself it doesn't add up. How do I convert from Euler angles back to degrees so it can be used in part orientation?
local BasePart = game.Workspace:WaitForChild("SpawnLocation")
local getToPart = game.Workspace.GetTo
local newCFrame = CFrame.new(BasePart.Position, getToPart.Position)
local x , y , z = newCFrame:ToEulerAnglesXYZ()
BasePart.CFrame = newCFrame
print("Part Orientation: ", BasePart.Orientation)
print("Euler Orientation: ", x , y , z)
print("Euler in Degrees: ", math.deg(x), math.deg(y), math.deg(z))
Output:
Part Orientation: 17.8799992, -112.339996, 0
Euler Orientation: 2.4376466274261 -1.0764619112015 2.4997501373291
Euler in Degrees: 139.66686369582 -61.676724318431 143.22513270621
-- Why is it 139.66 degrees instead of the original 17.87?
