Very cool feature!
Just want to callout for others who might’ve been a tad confused like I was that the rotation order is YXZ extrinsic!!!
That means you should be pulling the euler angles in ZXY order. You shouldn’t be using CFrame:ToOrientation()
or CFrame:ToEulerAnglesYXZ()
as that is attempting the pull the angles in intrinsic order.
So for example, to align with a cframe you should do:
game:GetService("RunService").PreRender:Connect(function(dt: number)
local x, y, z = workspace.CurrentCamera.CFrame:ToEulerAngles(Enum.RotationOrder.ZXY)
sky.SkyboxOrientation = Vector3.new(math.deg(x), math.deg(y), math.deg(z))
end)
Hope that helps others!