Skip to content

API ‐ Components

PhoenixWhitefire edited this page Oct 9, 2026 · 61 revisions

The Engine has a compositional object system. GameObjects have "base" APIs (properties, methods, events) that can be extended by giving them "components." These are transparent to scripts, adding a Component immediately makes their properties etc accessible via the Object. All components, as well as the base API, are described below.

GameObject

Properties

Enabled: boolean

If this is false, the Engine will not render, compute physics for or otherwise update this Object and its subtree

Name: string

The name of the Object, usually what was passed into GameObject.new

read ObjectId: number

The ID of the Object, an integer. Remains the same throughout the session, but not guaranteed between sessions

Parent: GameObject?

The hierarchal parent of the Object, or nil if it does not have one

Serializes: boolean

Whether or not the Object should be saved with the scene if it is serialized with AssetManager:SaveScene, and whether :Duplicate will duplicate it (only applies to descendants)

read TreeEnabled: boolean

Whether this object and all of its ancestors are enabled

Methods

function AddComponent(Component: keyof<Creatables>)

Adds the specified Component to the Object. Will error if it already has it (use :HasComponent to check beforehand)

function AddTag(Tag: string)

Adds a Collections tag to the Object. Has no effect if the Object already has the tag

function AsComponent<T>(Component: T & keyof<Components>): (GameObject & index<Components, T>)?

Returns nil if the component does not exist on the object, and, in Luau, a narrowed type if it does

function Destroy()

Marks the Object as "pending for destruction". This may or may not remove the Object from memory immediately, depending on whether the Engine is keeping a internal reference to it

function Duplicate<T>( & T): GameObject & T

Creates a duplicate of the Object

function FindChild(ChildName: string): GameObject?

Returns a child Object with the given name, or nil if one doesn't exist

function FindChildWithComponent<T>(T & keyof<Components>): GameObject & index<Components, T>

Returns a child Object which has the given component, or nil if one doesn't exist

function GetChildren(): { GameObject }

Returns a list of the Object's direct children

function GetComponents(): { keyof<Creatables> }

Returns a list of the names of all Components that the Object currently has

function GetDescendants(): { GameObject }

Returns all descendants of the Object (i.e. its children, and their children, etc)

function GetFullName(): string

Returns the full, hierarchal path of the Object

function GetTags(): { string }

Returns a list of all tags the Object has

function HasComponent(Component: keyof<Creatables>): boolean

Returns whether or not the Object has the given Component

function HasTag(Tag: string): boolean

Returns whether or not the Object has the given Collections tag

function IsDescendantOf(Ancestor: GameObject): boolean

Returns whether or not the Object is a descendant (child or indirect child) of the given object

function RemoveComponent(Component: keyof<Creatables>)

Removes the specified Component from the Object. Will error if does not have it (use :HasComponent to check beforehand)

function RemoveTag(Tag: string)

Removes the given Collections tag from the Object. Has no effect if the Object does not have the tag

Events

OnTagAdded:Connect(function(Tag: string)

Fires when the Object receives a new tag, passing the tag to the callback

OnTagRemoved:Connect(function(Tag: string)

Fires when the Object loses a tag, passing the tag to the callback

OnTreeEnabledChanged:Connect(function(TreeEnabled: boolean)

Fires when the value of .TreeEnabled changes

OnWorkspaceChanged:Connect(function(Previous: GameObject, Current: GameObject)

Fires when the Object moves between Workspaces

Animation

An animation

Properties

Animation: string

The animation file

Looped: boolean

Whether the track should loop when it reaches the end

Playing: boolean

Whether the track is playing

Time: number

The current time position of the track

Weight: number

The influence the track has over the rig. Not implemented yet

Animator

  • Animates

Properties

Animating: boolean

Whether the Animator will step its animations

AssetManager

Used to manipulate assets within the Engine

Methods

function GetMeshData(Id: string): MeshAssetData

Returns the provided mesh data associated with the provided path

function ImportModel(Path: string): GameObject & EcModel & EcTransform

Imports the glTF 2.0 model at the provided path and returns it as a Model GameObject

function LoadScene(Path: string): ({ GameObject }?, string)

Loads GameObjects from the scene file at the provided path, returning a list of the root objects or nil and an error message upon failure

function QueueLoadTexture(Path: string, LoadInLinearSpace: boolean?)

Queues a texture to be preloaded

function SaveMesh(Id: string, Path: string)

Saves the mesh data at the provided path to a file

function SaveScene(RootNodes: { GameObject }, Path: string): (boolean, string?)

Saves the list of GameObjects to the provided path, returning whether the operation succeeded

function SetMeshData(Id: string, MeshData: MeshAssetData | buffer)

Associates the provided mesh data with the provided path

function UnloadMaterial(Material: string)

Removes the given Material path from the Engine's cache

function UnloadMesh(Mesh: string)

Removes the given Mesh path from the Engine's cache

function UnloadTexture(Texture: string)

Removes the given texture from the Engine's cache, forcing it to be reloaded upon next use

Bone

  • Represents a Bone of a Mesh
  • Created automatically when the asset of a Mesh component finishes loading

Properties

read IsActive: boolean

Whether or not the Bone Object is actively affecting a Mesh

read SkeletalBoneId: number

The internal ID of the bone, valid range is 0-255

read TargetMesh: GameObject

The Mesh component containing Object the Bone is currently targeting. Note that this property is read-only, and will only either be equal to the Mesh that created the Bone, or nil

Transform: Matrix

The transformation of the Bone

Camera

A 3D camera

Properties

FieldOfView: number

The field-of-view. By default, 90

UseSimpleController: boolean

Whether it is affected by the built-in controller (W/A/S/D horizontal movement, Q/E vertical, Mouse to look around)

Collections

  • Manage Collections of Objects with tags
  • An Object can have any number of tags
  • Tags can be added to Objects with Object:AddTag, removed with Object:RemoveTag, and checked with Object:HasTag

Methods

function GetCollections(): { string }

Returns a list of all collections that the Collections system has recognized. They may be empty. Order is not guaranteed

function GetComponentCreatedSignal<T>(Component: T & keyof<Components>, DataModel: (GameObject & EcDataModel)?): EventSignal<(Object: GameObject & index<Components, T>) -> (), GameObject & index<Components, T>>

Returns a signal that fires when a given component is created from the world

function GetComponentDeletedSignal(Component: keyof<Components>, DataModel: (GameObject & EcDataModel)?): EventSignal<(Object: GameObject) -> (), GameObject>

Returns a signal that fires when a given component is deleted from the world

function GetObjectsWithComponent<T>(Component: T & keyof<Components>, DataModel: (GameObject & EcDataModel)?): GameObject & index<Components, T>

Returns a list of all objects with the given component

function GetTagAddedSignal(Tag: string): EventSignal<(Object: GameObject) -> (), GameObject>

Returns a signal that fires when the given tag is added to any Objects

function GetTagRemovedSignal(Tag: string): EventSignal<(Object: GameObject) -> (), GameObject>

Returns a signal that fires when the given tag is removed from any Objects, including when an Object with a tag is :Destroy'd

function GetTagged(Tag: string): { GameObject }

Returns a list containing all Objects with the given tag

function Query<C>({ read ComponentDefinition & C }): { GameObject & C }

Returns a list of all objects with the specified Luau components

DataModel

The root of the scene

Properties

read AreScriptsBound: boolean

If this is true, attempting to change .LiveScripts will throw an error

LiveScripts: string

May either refer to a directory of Scripts, or a single Script, to run when the DataModel is bound

read Time: number

Number of seconds since the Engine started running

VM: string

The Luau Virtual Machine that Scripts bound to this Data Model will run in

Methods

function BindToClose(Callback: () -> ())

Sets a callback that is invoked when the datamodel is being destroyed. May only be called once. Callback cannot yield

function Close(ExitCode: number?)

Closes the application with the specified exit code integer or 0

function GetService<T>(Service: keyof<Services> & T): GameObject & index<Services, T>

Gets the Object representing the specified Service. If it does not exist yet in the Data Model, it is created

Events

Closing:Connect(function()

This event fires when the datamodel is closing. Do not yield within the callback as the thread may never be resumed again

OnFrameBegin:Connect(function(DeltaTime: number)

Fires at the beginning of a frame, passing in the time elapsed since the last frame (delta time)

DeveloperTools

Built-in development tools

Properties

DocumentationShown: boolean

Whether the Documentation tool is enabled

ExplorerShown: boolean

Whether the Explorer tool is enabled

InfoShown: boolean

Whether the Info tool is enabled

read Initialized: boolean

Whether developer tools were ever initialized

MaterialsShown: boolean

Whether the Materials tool is enabled

PropertiesShown: boolean

Whether the Properties tool is enabled

RendererShown: boolean

Whether the Renderer tool is enabled

ScriptsShown: boolean

Whether the Scripts tool is enabled

SettingsShown: boolean

Whether the Settings tool is enabled

ShadersShown: boolean

Whether the Shaders tool is enabled

Methods

function CloseTextDocuments()

Saves and closes all open text documents

function GetDocumentBreakpoints(File: string): { DebugBreakpointInfo }

Gets a list of all breakpoints associated with a text document. If it is not open, returns an empty table

function GetExplorerSelections(): { GameObject }

Returns what is currently selected in the Explorer

function GetOpenTextDocuments(): { string }

Gets a list of all open text documents

function GetToolNames(): { string }

Returns a list of valid Engine tools

function Initialize()

Initializes the developer tools system if it was not already initialized

function IsToolEnabled(ToolName: string): boolean

Returns whether the given tool is enabled

function OpenTextDocument(Path: string, Line: number?, TakeFocus: boolean?)

Opens a text file. This requires Developer Mode to be enabled to have any effect

function SaveTextDocuments()

Saves all open text documents

function SetDocumentBreakpoints(File: string, Breakpoints: { read DebugBreakpointInfo })

Sets the breakpoints of a text document. This will queue if the document is not open at the time of the call

function SetExplorerRoot(Root: GameObject)

Changes the Root of the built-in Explorer's hierarchy view

function SetExplorerSelections(Selections: { GameObject })

Changes the built-in Explorer's Object selections to the specified Objects

function SetToolEnabled(ToolName: string, Enabled: boolean)

Enabled/disables the given tool

Events

BreakpointRemoved:Connect(function(File: string, Line: number)

Fires when a breakpoint is removed

BreakpointUpdated:Connect(function(File: string, Breakpoint: DebugBreakpointInfo)

Fires when a breakpoint is added or modified

DebuggerRequestedStop:Connect(function()

Fires when the developer clicks 'Stop' in the debugger

DirectionalLight

Intended to model a large light source infinitely far away, like the Sun

Properties

Brightness: number

How bright the Light is

Direction: vector

The direction light is emitted from

LightColor: Color

The color of the Light

ShadowViewDistance: number

How far back the shadow view is offset from the focus

ShadowViewFarPlane: number

The Far Z plane of the shadow view. Should be greater than ShadowViewNearPlane

ShadowViewMoveWithCamera: boolean

Sets the focus of the shadow view to be the Scene Camera

ShadowViewNearPlane: number

The Near Z plane of the shadow view. Should be less than ShadowViewFarPlane. Shouldn't be 0

ShadowViewOffset: vector

Offset of the shadow view from the focus, after ShadowViewDistance is applied

ShadowViewSize: number

Size of the shadow view. Sets ShadowViewSizeH and ShadowViewSizeV to the assigned value if they are equal. Is -1 if they are not equal

ShadowViewSizeH: number

Horizontal size of the shadow view

ShadowViewSizeV: number

Vertical size of the shadow view

Shadows: boolean

Whether the Light can render shadows

Engine

Inspect and manipulate various parts of the Engine

Properties

read CommitHash: string

The Git commit that was used to produce this Engine build

read CommitTag: string

The relationship between the Engine's commit at the nearest Release tag

read Framerate: number

The Engine's current framerate

FramerateCap: number

The maximum framerate the Engine will reach before attempting to self-limit

read IsHeadless: boolean

Whether the Engine is currently running in headless mode

read TargetPlatform: string

The target platform the Engine was compiled for (Windows or Linux, usually)

read Version: string

The version of the Engine build

Methods

function BindDataModel(DataModel: GameObject & EcDataModel, State: { read Rendered: boolean, read Simulated: boolean })

Binds the datamodel provided. Bound datamodels fire their OnFrameBegin events

function GetCliArguments(): { string }

Returns the list of launch arguments given to the Engine. The first item is always a path to the Engine executable

function GetConfigValue(Key: string): JsonDecodable

Returns the value associated with the given Key in the Engine's loaded configuration (phoenix.conf)

function SetForegroundDataModel(DataModel: GameObject & EcDataModel)

Switches the foreground datamodel to the one provided. Foreground datamodels are what are rendered on screen

function SetWindowTitle(Title: string)

Sets the title of the game window

function ShowMessageBox(Title: string, Message: string, Buttons: 'ok' | 'okcancel' | 'yesno' | 'yesnocancel' | nil, Icon: 'info' | 'warning' | 'error' | 'question' | nil, DefaultButton: number?): number

Shows a message box to the player with the given specification. The returned number with be the selected option: 0 for Cancel/No, 1 for Ok/Yes, 2 for No in yesnocancel. This is a blocking operation and no scripts or other parts of the Engine run until the message is dismissed. Avoid using quotes and backticks in the message

function UnbindDataModel(DataModel: GameObject & EcDataModel)

Unbinds a previously bound datamodel

Environment

World lighting and ambiance

Properties

AmbientLight: Color

Base environment ambient light color (Uniform: Phoenix_LightAmbient)

BloomEnabled: boolean

Whether bloom is enabled

BloomScale: number

The sample size for the bloom relative to the screen

BloomStdDeviation: number

The standard deviation for the gaussian function used for the bloom, affecting the "width"

BloomThreshold: number

The threshold luminance at which pixels should bloom

Fog: boolean

Fog enablement (Uniform: Phoenix_Fog)

FogColor: Color

Color of the fog (Uniform: Phoenix_FogColor)

GammaCorrection: number

Post-processor gamma correction amount (Uniform: Phoenix_Gamma)

PostProcess: boolean

Post-processor enablement (Uniform: Phoenix_PostFxEnabled)

Skybox: string

The skybox asset. May either be a path directly to an equirectangular panorama image, or a directory containing [right/left/top/bottom/front/back].jpg (cubemap). Will error when attempting to assign an invalid path. Cubemap directory paths must contain 'Sky' (case-sensitive) somewhere in them :)

History

Service for implementing Undo/Redo systems

Properties

read ActionHistorySize: number

The total number of Actions that have finished being recorded

read CanRedo: boolean

Whether :Redo will succeed

read CanUndo: boolean

Whether :Undo will succeed

read CurrentActionName: string?

The name of the Action currently being recorded, or nil if no recording is in progress

read CurrentWaypoint: number

The ID of the Action that was last finished

read IsRecordingAction: boolean

Whether an Action is currently being recorded by History

RecordingEnabled: boolean

Whether events will be recorded

TargetDataModel: GameObject

The DataModel that History will track

Methods

function ClearHistory()

Clears all recorded history

function DiscardAction(Id: number)

Discards the Action by its ID

function FinishAction(Id: number)

Finishes the Action by its ID. Only one Action may be active at a time

function GetActionData(Index: number): HistoryAction

Retrives information about a previously-recorded Action by its Index (Indexes, separate from IDs, are in the range 0 <= Index < ActionHistorySize)

function GetCannotRedoReason(): string

Returns a message explaining why .CanRedo is false

function GetCannotUndoReason(): string

Returns a message explaining why .CanUndo is false

function GetCurrentActionData(): HistoryAction?

Retrieves information about the current Action being recorded

function Redo()

Forwards the state of the scene to how it was before the last Undo. If .CanRedo is false, will throw an error

function TryBeginAction(Name: string): number?

Attempts to begin an "Action." Returns the ID of the action. May fail and return nil. Only one Action may be active at a time

function Undo()

Reverses the state of the scene to how it was before the last Action began. If .CanUndo is false, will throw an error

Interface

  • Contains the player's interface elements
  • See UITransform, UIFrame, UIText, UIImage, and UIButton

No members defined

Logging

Engine logging

Methods

function Write(Message: string, Type: EnumLogType, ExtraTags: string?)

Log a message

Events

OnMessaged:Connect(function(Time: number, Type: EnumLogType, Message: string, ExtraTags: string, Values: { LoggingLogValue })

Fires whenever a Log Message is created

LuauData

Internally stores what Luau components attached to the object.

No members defined

Mesh

A mesh composed of triangles

Properties

CastsShadows: boolean

Whether it casts shadows

FaceCulling: EnumFaceCulling

Which faces of the mesh to cull based on viewing direction. See the FaceCulling enum

Material: string

The name of the .mtl in the resources/materials/ directory it should use

MeshAsset: string

The path to the underlying .hxmesh file, or a built-in identifier like !Quad or !Cube

MetalnessFactor: number

Metalness modifier

RoughnessFactor: number

Roughness modifier

Tint: Color

The Color it should be tinted with

Transparency: number

Its transparency/translucency

Model

A container

Properties

ImportPath: string

The original file a model was imported from

Network

Networking

Methods

function MakeHttpRequestAsync({ Url: string, Method: nil | 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'PATCH', Headers: { [string]: string }?, Body: string? }): { Ok: boolean, Status: number, Headers: { [string]: string }, Body: string }

Makes an HTTP request to the provided URL. Ok will be false upon failure, and Body will contain the error message

ParticleEmitter

An emitter of 2D particles

Properties

Emitting: boolean

Whether the emitter should emit new particles

Image: string

The path to the image to use for the particles

Lifetime: vector

The X and Y components act as a range of how long any particle can last, in seconds

LinearlySmoothened: boolean

Whether the particle image is smoothened

ParticlesAreAttached: boolean

Whether the particles are attached to and move with the emitter

Rate: number

An integer indicating how many particles should be emitted per second (must be above or equal to 0)

Physics

Manipulate the Physics simulation of the Engine

Properties

DebugCollisionAabbs: boolean

Whether physics collision AABBs are rendered

DebugContactPoints: boolean

Whether Contact Points are rendered

DebugSpatialHeat: boolean

Whether Spatial Heat (spatial hash density) debug rendering is enabled

Gravity: vector

The gravitational field strength

Simulating: boolean

Whether the Physics simulation is running. IMPORTANT: The Editor sets this value to true and false when starting/stopping playtests

Timescale: number

Slow-down or speed-up the simulation by changing this value from 1

Methods

function SetSimulationForcePaused(Paused: boolean)

If passed true, forces the simulation to be paused, regardless of the value of .Simulating

PlayerInput

Checking player inputs

Properties

Cursor: EnumCursor

The look of the cursor. See Enum.Cursor. Setting this property is slow as it needs to poll the OS, avoid placing it in hot loops

CursorMode: EnumCursorMode

The current mode/behaviour of the cursor. Refer to the Enum.CursorMode enumeration

read IsKeyboardSunk: boolean

Whether the Engine is currently using keyboard input (such as for Dear ImGui). Do not process keyboard input if this is true

read IsMouseSunk: boolean

Whether the Engine is currently using mouse input (such as for Dear ImGui). Do not process mouse input if this is true

Methods

function GetCursorPosition(): vector

Returns the current position of the mouse cursor relative to the window as a vector

function GetViewportInputRect(): (vector, vector)

Gets the input rectangle area, returning its position and size

function IsKeyPressed(Key: EnumKey): boolean

Returns whether the specified key (e.g. Enum.Key.A, Enum.Key.One) is currently being pressed

function IsMouseButtonPressed(Button: EnumMouseButton): boolean

Returns whether the specified mouse button (Enum.MouseButton.Left/Middle/Right) is currently being pressed

function ResetViewportInputRect()

Resets the Engine's understanding of where the viewport is on screen back to the default (occupying the entire window)

function SetViewportInputRect(Position: vector, Size: vector)

Configures the Engine to act as through the Viewport is at the given position with the given size. Does not change where the viewport is actually rendered

Events

KeyEvent:Connect(function(Event: KeyInputEvent)

Fires whenever a key-related event occurs

MouseButtonEvent:Connect(function(Event: MouseButtonInputEvent)

Fires whenever a mouse-button-related event occurs

ScrollEvent:Connect(function(Event: ScrollInputEvent)

Fires whenever the player scrolls with a scroll device (such as the mouse wheel)

PointLight

A light source emitting light omnidirectionally from its Transform

Properties

Brightness: number

How bright the Light is

LightColor: Color

The color of the Light

Range: number

How far light is emitted. If >= 0, the Range is used and attenuation is linear, otherwise it uses the formula F = 1/D^2 * B to mirror real-world attenuation, where F is the final brightness, D is the distance of a point from the Light, and B is the Brightness property's value

Renderer

Interfacing with the Engine's rendering systems

Properties

DebugWireframeRendering: boolean

Whether the Wireframe rendering debug mode is enabled

IsFullscreen: boolean

Whether the Window is currently fullscreened

Resolution: vector

The size of the window, in pixels

VSync: boolean

Whether Vertical Synchronization is enabled

Methods

function SetShaderTextureVariable(Shader: string, Variable: string, TexturePath: string, InLinearColorSpace: boolean)

Sets a variable in a shader program to a 2D texture sampler for the provided image. The program will be loaded if it is not already in memory

function SetShaderVariable(Shader: string, Variable: string, Value: boolean | number | vector | Color | Matrix, Type: EnumValueType?)

Sets a variable in a shader program (qualified uniform). The program will be loaded if it is not already in memory. Type is required when passing a vector, to differentiate between Vector2 and Vector3. See Enum.ValueType

RigidBody

Something rigid that participates in the Physics simulation

Properties

AngularVelocity: vector

Its rotational velocity

CollisionType: EnumCollisionType

Determines how collisions are detected. See the CollisionType enum

Density: number

Its density (Mass = Density * Size)

Friction: number

Fraction of Velocity it should lose per second while in contact with another object while PhysicsDynamics is true

GravityFactor: number

Influence of the force of gravity

HullsFile: string

The file containing a set of convex hull meshes to load. Used for when .CollisionType is Hulls

LinearVelocity: vector

Its velocity

PhysicsCollisions: boolean

Whether other physics objects can collide with it

PhysicsDynamics: boolean

Whether the Physics engine should apply forces to it

PhysicsRotations: boolean

Whether the Physics engine will apply angular impulses to rotate the object on collisions. Prefer to keep this at false as the simulation is not very precise

Restitution: number

Restitution

ScriptEngine

Managing Luau

Methods

function CloseVM(VmName: string)

Closes the specified Luau VM, releasing its resources

function CompileToBytecode(Source: string, OptimizationLevel: number?, DebugLevel: number?): buffer

Compiles the given Luau source code to Luau bytecode. OptimizationLevel and DebugLevel may be 0-2, or -1 for default

function CreateVM(VmName: string)

Creates a new Luau VM with the given name. The workspace and game globals of the VM are taken from the currently-bound DataModel

function DetachDebuggerFromVM(VM: string)

Detaches the Developer-mode exclusive debugger from a VM, if it is attached. No effect otherwise

function RunInVM(VmName: string, Code: string, ChunkName: string): (boolean, string?)

Runs the given code in the specified VM. Returns false and an error message upon failure or if the code does not finish executing (yield or break)

function SetScriptBreakpoint(VM: string, ScriptPath: string, Line: number, Enabled: boolean): number

Sets the breakpoint for a given script, returning the line number it was applied to. If the script has not loaded yet, it will queue the breakpoint and return the requested line number. The line number may be different than what was requested. Changes for queued breakpoints are signaled by .BreakpointMoved

function SetVMAllowedExecutionTime(VmName: string, Length: number)

Sets how long script coroutines are allowed to run for, in seconds, before yielding. Scripts that overrun this duration will error

Events

BreakpointMoved:Connect(function(File: string, RequestedLine: number, ActualLine: number)

Fires when a breakpoint queued by :SetScriptBreakpoint is applied to a different line number than originally requested

Sound

A sound

Properties

read FinishedLoading: boolean

Whether the Sound has finished loading the SoundFile

read Length: number

The length of the sound in seconds

read LoadSucceeded: boolean

Whether or not the sound loaded successfully

Looped: boolean

Whether playback should loop once it reaches the end

Playing: boolean

Whether the Sound is currently playing (or requested to play, if .Playing is set to true by a Script before it has finished loading)

SoundFile: string

The sound file to be played

Speed: number

The speed at which the sound plays, within the range of 0.01 to 100

TimePosition: number

The playback position of playback in number of seconds from the beginning of the file

Volume: number

The volume at which the sound plays. Must be positive

Methods

function Play()

Play the Sound from the beginning

SpotLight

A light which emits in a conical shape

Properties

Angle: number

The Field-of-View (in radians) of light emission

Brightness: number

How bright the Light is

LightColor: Color

The color of the Light

Range: number

How far light is emitted

Transform

Gives a physical position and size to an Object

Properties

LocalTransform: Matrix

The Object's transformation, relative to its parent Transform ancestor or the world origin

Transform: Matrix

The Object's world-space transformation

Events

OnScriptMoved:Connect(function(Previous: Matrix, Current: Matrix)

Fires when a script moves the object

UIButton

Button behaviour

Properties

IsClicking: boolean

Whether the cursor is currently holding the button down

IsHovering: boolean

Whether the cursor is currently hovering over the button

Events

ClickChanged:Connect(function(IsHolding: boolean)

Fires when the button click state changes

HoverChanged:Connect(function(IsHovering: boolean)

Fires when the button hover state changes

UIFrame

A frame

Properties

BackgroundColor: Color

The color of the frame

BackgroundTransparency: number

Its transparency

UIImage

An image element

Properties

Image: string

The path to the image

ImageTint: Color

The color the image is tinted with

ImageTransparency: number

Its transparency

UIText

  • Text
  • The scale depends on the minimum of the two axes of Size

Properties

Text: string

The text string to be displayed

TextColor: Color

The color of the text

TextTransparency: number

The transparency of the text

UITransform

Offsets the element tree

Properties

Position: vector

The 2D position, from 0-1

Rotation: number

The 2D rotation (not functional)

Size: vector

The 2D scale, from 0-1

ZIndex: number

The ordering indexing, higher being further in front (not functional)

Workspace

  • The container used for storing the main parts of a scene (3D objects)
  • If this is Destroy'd, the application closes

Properties

SceneCamera: GameObject & EcCamera & EcTransform

The Camera the Player sees the world through. If set to nil, a fallback is created at the origin

Methods

function GetObjectsInAabb(Position: vector, Size: vector, IgnoreList: { GameObject }?): { GameObject & EcRigidBody & EcTransform }

Get a list of Objects whose bounds are within the AABB

function Raycast(Origin: vector, CastVector: vector, FilterList: { GameObject }?, FilterIsIgnoreList: boolean?): { Object: GameObject & EcRigidBody & EcTransform, Position: vector, Normal: vector }?

Cast a ray. This currently treats collisions as Axis-Aligned Bounding Boxes!

function ScreenPointToVector(ScreenPoint: vector, Length: number?): vector

Converts the provided screen coordinates to a world-space direction. Length is optional and 1.0 by default

function WorldToScreenPoint(WorldPoint: vector): (vector, number)

Converts the provided world coordinate (vector) into its location in screen-space pixel coordinates, additionally returning the depth

Clone this wiki locally