We use cookies on this site to enhance your user experience

Workspace

Workspace

The Workspace is the service in which any objects that are to be rendered in the 3D world exist. Objects not descending from Workspace will not be rendered or physically interact with the world.

What does the Workspace do?

The core job of the Workspace is to hold objects that exist in the 3D world, BaseParts and Attachments. Whilst such objects are descendant of Workspace, they will be active. For BaseParts this means they will be rendered, and physically interact with other parts and the world. For Attachments this means objects adorned to them, such as ParticleEffects, Beams and BillboardGuis will render.

Understanding this behavior is important, as it means objects can be removed from the Workspace when they are not needed. For example, map Models can be removed from the Workspace when a different map is being played on. Objects that are not immediately needed in the Workspace are generally stored in ReplicatedStorage or ServerStorage.

In its role as the holder of active 3D objects, Workspace includes a number of useful functions related to parts, their positions and joints between them. Commonly used are the Workspace’s raycasting functions, such as Workspace/FindPartOnRay.

Accessing the Workspace

The Workspace can be accessed several ways, all of which are valid.

workspace -- a global variable
game.Workspace -- a property of the DataModel
game:GetService("Workspace") -- workspace is a service

Notes

  • Objects that require adornment, such as ParticleEmitters and BillboardGuis will be adorned to the 0, 0, 0 position when adorned to the Workspace (parented to it without an adornee otherwise being set)
  • The Model/MakeJoints and Model/BreakJoints functions inherited from the Model class are overridden by the Workspace’s own Workspace/MakeJoints and Workspace/BreakJoints functions, which can only be used in plugins
  • It is impossible to delete the Workspace
  • The Workspace will also clean up BaseParts that fall beneath Workspace/FallenPartsDestroyHeight
  • A client’s current Camera object can be accessed using the Workspace/CurrentCamera property
  • The Terrain object can be accessed using the Workspace/Terrain property

Properties

Name Type Description
bool

Determines whether assets created by other uses can be sold in the game.

Camera

The Camera object being used by the local player.

double

The amount of time, in seconds, that the game has been running.

float

Sets the height at which falling BaseParts (and their ancestor Models) are destroyed.

bool

Determines whether changes made from the client will replicate to the server or not. When this property is disabled, the game is in ‘Experimental Mode’.

float

Determines the acceleration due to gravity applied to falling BaseParts.

bool

Toggles whether or not the game will use the Projected Gauss-Seidel physics solver, or the legacy Spring physics engine.

bool

Whether network streaming is enabled for the place or not.

Instance

A reference to the Terrain object parented to the Workspace.

Inherited from Instance , PVInstance , Model , RootInstance

Archivable ClassName DataCost Name Parent RobloxLocked PrimaryPart

Functions

Name Type Description
void

Goes through all BaseParts given, breaking any joints connected to these parts.

bool

Returns true if the game has the PGS Physics solver enabled.

Tuple

Returns the first BasePart intersecting with the given DataType/Ray.

Tuple

Returns the first BasePart intersecting with the given DataType/Ray that isn’t in, or a descendant of an object in, the given ignore list.

Tuple

Returns the first BasePart intersecting with the given DataType/Ray that is in, or descendant of an object in, the given white-list.

Objects

Returns an array of BaseParts in the given DataType/Region3.

Objects

Returns an array of BaseParts in the given DataType/Region3 that aren’t in, or a descendant of an entry in, the given IgnoreList.

Objects

Returns an array of BaseParts in the given DataType/Region3 that are in, or descendant of an object in, a given white list.

int

Returns the number of BaseParts that are deemed physically active, due to being recently under the influence of physics.

bool

Returns true if the game has been paused due to over-constrained issues being detected by the Physics Analyzer.

Objects

Returns an array of BaseParts associated with a given physics over-constraint issue.

int

Returns an integer, between 0 and 100, representing the percentage of real-time that physics simulation is currently being throttled to.

double

Returns the number of frames per second that physics is currently being simulated at.

bool

Returns a bool stating if no BaseParts are in the given DataType/Region3.

bool

Returns a bool stating if no BaseParts are in the given DataType/Region3, ignoring any BaseParts that are in, or descend from objects in, the ignore list given.

void

Creates joints between the specified BaseParts and any touching parts depending on the BasePart's surfaces and the specified joint creation mode.

void

Goes through all BaseParts given. If any part’s side has a Enum/SurfaceType that can make a joint it will create a joint with any adjacent parts.

bool

Returns true if the game has the PGS Physics solver enabled.

void

Sets whether or not the Physics Analyzer should continue to actively analyze the physics or not.

void

Sets whether physics throttling is enabled or disabled.

void

Breaks all joints between the specified BaseParts and other BaseParts.

void

Positions and zooms the Workspace/CurrentCamera to show the extent of BaseParts currently in the Workspace.

Inherited from Instance , PVInstance , Model , RootInstance

ClearAllChildren Clone Destroy FindFirstAncestor FindFirstAncestorOfClass FindFirstAncestorWhichIsA FindFirstChild FindFirstChildOfClass FindFirstChildWhichIsA GetChildren GetDebugId GetDescendants GetFullName GetPropertyChangedSignal IsA IsAncestorOf IsDescendantOf WaitForChild BreakJoints GetExtentsSize GetPrimaryPartCFrame MakeJoints MoveTo SetPrimaryPartCFrame TranslateBy

Events

Name Type Description

This event is fired when over-constraint issues are found in the Physics Analyzer.

Inherited from Instance , PVInstance , Model , RootInstance

AncestryChanged Changed ChildAdded ChildRemoved DescendantAdded DescendantRemoving