The part will always be in 90 degree increments in orientation, but what CFrame calculations would I need to do in what order to find the surface area of the side that is facing upward?
I’m assuming your part is rectangular. if so then it should be pretty simple, just a bit tedious to write. this is because the normal of a face will always be RightVector, UpVector, LookVector or their negative counterparts. it works for any orientation (whichever faces the most up).
function SAFromTop(part) -- find which side faces most “upwards” or “downwards” by checking the y of each normal -- if it faces the opposite direction the surface area is still the same on the opposite side because it’s rectangular, so downwards still counts local function compare(axis1, axis2) return math.abs(part.CFrame.YVector[axis1]) > math.abs(part.CFrame.YVector[axis2]) and axis1 or axis2 end local axis = compare(“X”, “Y”) axis = compare(axis, “Z”) if axis == “X” then return part.Size.Y * part.Size.Z elseif axis == “Y” then return part.Size.X * part.Size.Z else -- axis == “Z” return part.Size.X * part.Size.Y end end
of course things get more complicated when it’s not a square...