Services
Workspace
The root of the live world hierarchy and the home of the current Camera and physics raycasts.
Access
Luau
local Workspace = game:GetService("Workspace")
print(Workspace == game.Workspace)
print(Workspace == workspace)workspace, game.Workspace, and game:GetService("Workspace") all expose the same Workspace service.Members
| Name | Type | Description |
|---|---|---|
CurrentCamera | client Camera | The active client Camera object. It is unavailable to public ServerScripts. |
Raycast(origin, direction) | method | Casts through physics. The direction vector's length is the maximum cast distance. |
FindFirstChild(name, recursive?) | method | Finds a child or descendant. |
FindFirstChildOfClass(className) | method | Finds the first direct child with the exact ClassName. |
GetChildren() | method | Returns direct children. |
GetDescendants() | method | Returns all descendants. |
IsA(className) | method | Returns true for Workspace and Instance. |
GetFullName() | method | Returns Workspace. |
Hierarchy and rendering
Workspace ancestry determines whether physical Parts belong to the live rendered world. A Part does not need to be a direct Workspace child: it can be nested beneath Camera, Humanoid, another Part, a Value object, Model, Folder or another Instance and still render and participate in world physics while it remains a Workspace descendant.
Workspace also resolves direct child names through indexing, so workspace.Part can access a direct child named Part. For optional objects, FindFirstChild() is safer because it clearly returns nil when missing.