> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/development/api-reference/classes/surfacegui.md).

# SurfaceGui

SurfaceGui : `SurfaceGuiBase`

## Overview

SurfaceGui is a UI container that displays 2D UI elements (GuiObject) attached to a face of a BasePart. The face to display on is specified with the Face property, and unlike BillboardGui, which rotates to face the camera, it follows the orientation of the attached face as it is.

The position of this container is determined by the connected BasePart or a specified Adornee.

In addition, SurfaceGui internally caches rendering results and reuse them when there are no changes to optimize performance. However, if the properties of SurfaceGui itself are changed, the properties of child elements are changed, or child elements are added or removed, the screen information is recalculated in the next rendering frame.

SurfaceGui can be controlled only in **client environment**.

## Properties

### Face

`Enum.NormalId`

Specifies on which side of rendering object SurfaceGui should be displayed.

#### Code Samples

```lua
local SurfaceGui = script.Parent

SurfaceGui.Face = Enum.NormalId.Top
```

### PixelsPerUnit

`number`

Specifies the number of UI pixels to use per 1 unit (cm) of the attached face.

The pixel size of UI elements under the SurfaceGui is converted to a size on the face based on this value, and the larger the value, the smaller a UI element of the same pixel size is displayed on the face.

The default is 1, and values less than 0.01 are treated as 0.01.

#### Code Samples

```lua
local SurfaceGui = script.Parent

SurfaceGui.PixelsPerUnit = 2
```

### ZOffset

`number`

Specifies the overlapping order of SurfaceGuis placed on the same side.

#### Code Samples

```lua
local SurfaceGui = script.Parent

SurfaceGui.ZOffset = 2
```

## Methods

## Events

## See also

{% content-ref url="/pages/Hgp8bh8C44modKPwUBkg" %}
[GUI](/manual/studio-manual/gui.md)
{% endcontent-ref %}
