Skip to content

BillboardGui

Class ยท server and client scripts

BillboardGui anchors a 2D UI canvas to a 3D world entity so it always faces the camera. Access it through entity.BillboardGui.

Example

-- Server script.
local tag = World.Spawn({
    BillboardGui = {
        Width = 140,
        Height = 36,
        UnitsOffset = Vector3.new(0, 2.5, 0),
        MaxDistance = 60,
    },
})
tag.Parent = self

Target

Property
Target: Entity?

Target is the entity the canvas floats over; nil uses the entity's parent.

UnitsOffset

Property
UnitsOffset: vector

UnitsOffset shifts the canvas in camera space: X right, Y up, and Z toward the camera, in world units.

Width

Property
Width: number

Width is the canvas width in UI points, scaled like the HUD.

Height

Property
Height: number

Height is the canvas height in UI points, scaled like the HUD.

AnchorX

Property
AnchorX: number

AnchorX is the horizontal point on the canvas placed at the anchor: 0 is the left edge and 1 is the right edge.

AnchorY

Property
AnchorY: number

AnchorY is the vertical point on the canvas placed at the anchor: 0 is the top edge and 1 is the bottom edge.

MaxDistance

Property
MaxDistance: number

MaxDistance hides the canvas past this distance in world units, fading over the last 30 percent; 0 never hides by distance.

AlwaysOnTop

Property
AlwaysOnTop: boolean

AlwaysOnTop draws the canvas over world geometry instead of depth-testing behind walls.

ClampToScreen

Property
ClampToScreen: boolean

ClampToScreen keeps the canvas on screen when its world anchor moves outside the viewport.

EdgeFadeStart

Property
EdgeFadeStart: number

EdgeFadeStart is the normalized device coordinate distance past the screen edge where a clamped canvas starts fading.

EdgeFadeEnd

Property
EdgeFadeEnd: number

EdgeFadeEnd is the normalized device coordinate distance past the screen edge where a clamped canvas hides; 0 never hides.

ViewerDistance

Property
ViewerDistance: number

ViewerDistance hides the canvas past this distance from the viewer's character, fading over the last 30 percent; 0 never hides.