ive already tried a code from devforum, but it doesnt work, so how do i detect what side of a cube is up?
the code btw:
function findSide(part)
local cf=part.CFrame
local cs={side=nil,y=-2}
if cf.lookVector.Y>cs.y then cs.side="FrontSurface" cs.y=cf.lookVector.Y end
if -cf.lookVector.Y>cs.y then cs.side="BackSurface" cs.y=-cf.lookVector.Y end
if cf.rightVector.Y>cs.y then cs.side="RightSurface" cs.y=cf.rightVector.Y end
if -cf.rightVector.Y>cs.y then cs.side="LeftSurface" cs.y=-cf.rightVector.Y end
if cf.upVector.Y>cs.y then cs.side="TopSurface" cs.y=cf.upVector.Y end
if -cf.upVector.Y>cs.y then cs.side="BottomSurface" cs.y=-cf.upVector.Y end
return script.Parent.numdisplay.TextLabel.Text
end
Im trying to change a textlabels text to the side that the cube is on, but nothing is changing.

3 comments
ok cool, is there a way to make it change if the side of the cube changes? also, is there a way to number the surfaces and display the number?
Make it change what exactly ? And yes there is a way to number the surfaces.
so if i move the cube and then the right surface is up, it should say rightsurface