CameraUI Module Documentation

CameraUI is a client-side Luau module for Roblox that allows you to create and manage UI elements that are rendered in 3D space, attached to the camera. It is intended for use on the client; server-side integration is up to the developer.

Features

Usage


local CameraUI = require(path.to.CameraUI)

-- Create a new UI measurement controller
local measurement = CameraUI:CreateUIMeasurement()

-- Create a new Camera UI element
local element = CameraUI:CreateUIElement({
    name = "MyElement",
    distanceAway = 10,
    uiElement = myGuiElement, -- Instance of a GuiBase
    customPart = nil,         -- Optional: custom part to use
    customFace = Enum.NormalId.Front, -- Optional: face for SurfaceGui
    position = {X = 0, Y = 0},       -- Optional: initial position
    rotation = {X = 0, Y = 0, Z = 0} -- Optional: initial rotation
})
    

Helpers

CameraUI:CreateUIMeasurement()

Creates a new measurement controller for camera UI.

CameraUI:CreateUIElement(data)

Creates a new camera UI element.
data: Table with the following fields:

Returns an object with methods to control the element.

Element Methods

CameraUI:GetActiveElement(name, data)

Returns the OOP object for the active element with the given name.

Notes