if math.abs(ray.Normal.Z) ~= 1 then
Crack.CFrame = CFrame.lookAt(ray.Position, ray.Position - Vector3.zAxis, ray.Normal);
else
Crack.CFrame = CFrame.lookAt(ray.Position, ray.Position - Vector3.xAxis, ray.Normal);
end
Clarification for future readers: This takes care of a special case of lookAt where if you look directly up or down relative to the up direction (third parameter) the chosen up direction effectively gets ignored. This is just the result of it not being possible to define a “look at” method that works in every direction consistently, there will always be two poles because you have to choose an up axis.