I got a block, with an orientation of 90, 90, 0. However, when I use ToOrientation, it returns 90, 0, 0…
--// Round to nearest number
function Helpers.RoundTo(number, nearest)
return math.floor(number / nearest + 0.5) * nearest
end
function Helpers.RotationFix(cFrame)
local X, Y, Z = cFrame:ToOrientation()
X = math.deg(X)
Y = math.deg(Y)
Z = math.deg(Z)
X = Helpers.RoundTo(X, 5)
Y = Helpers.RoundTo(Y, 5)
Z = Helpers.RoundTo(Z, 5)
return X, Y, Z
end
If I pass this block through this function, I EXPECT 90, 90, 0 to be returned.