function Click(mouse) script.Parent.Parent.Visible = false script.Parent.Parent.Parent.Menu.Visible = true end script.Parent.MouseButton1Down:connect(Click)
That is the basic script that I will use for all the menus. What would I do so that it would work on a SurfaceGUI?
SurfaceGui objects work exactly the same as ScreenGui objects, containing GUI objects to be presented.
They simply either require their Adornee property to be set to the part they are on, or to be the child of a part.
(Full list of SurfaceGui properties)
In addition, you should configure the CanvasSize of the SurfaceGui, which is a Vector2. CanvasSize
affects what an "offset" is for UDim2 (the width / height / length of a part is split into the resolution you give it in CanvasSize).
What is less obvious about CanvasSize is that it also represents the resolution to which objects can be positioned, i.e., even if you only use Scale in UDim2's to position elements, very low CanvasSize
s could cause artifacts.