FANDOM


The Workspace class represents the physical area in which a game mostly takes place. It has no actual physical boundaries, but there are technical boundaries, as heading too far away from the origin (0, 0, 0) will cause floating-point inaccuracies to occur, and rendering will, quite literally, get shaky. Heading too far away will not render anything at all, and you will be left with black screen. The Workspace is mostly used for housing the environment of a game. Other objects that may appear later are stored in ExplorerImageIndex 69ServerStorage. All the visible parts in a game must be put in the Workspace. Scripts, while usually put in ExplorerImageIndex 71ServerScriptService, will also run if they are put in the Workspace. The Workspace class inherits from Model.

Properties

Pubfield bool AllowThirdPartySales

Whether or not sales of assets not made by the game creator or ROBLOX are allowed.

Category: Behavior.

Serialization: can save and load.

Tags: NotReplicated.

Pubfield AutoJointsMode AutoJointsMode

Category: Behavior.

Serialization: can save and load.

Tags: NotScriptable.

Pubfield Camera CurrentCamera

The LocalPlayer's camera object. This property can only be used in ExplorerImageIndex 18LocalScripts.

Category: Data.

Serialization: can save and load.

Tags: NotReplicated.

Pubfield double DistributedGameTime

The amount of seconds that this server has been running since creation.

Category: Data.

Serialization: can save and load.

Tags: NotReplicated.

Protfield float FallenPartsDestroyHeight

This property sets the Y position at which everything that touches it will instantly be destroyed.

You can easily create something like this using the code below:

  • Tree-collapse
    ExplorerImageIndex 1
    Part
    • ExplorerImageIndex 6
      Script
script.Parent.Touched:Connect(function(hit)
    hit:Destroy()
end)

Category: Behavior.

Write security: PluginSecurity.

Serialization: can save and load.

Protfield bool FilteringEnabled

If turned on, things that happen on the client will not replicate to the server, preventing most exploits.

Category: Behavior.

Write security: PluginSecurity.

Serialization: can save and load.

Pubfield float Gravity

The bigger this value, the faster objects will hit the ground. If set to 0, parts cannot move up and down.

Category: Behavior.

Serialization: can save and load.

Pubfield bool StreamingEnabled

Category: Behavior.

Serialization: can save and load.

Pubfield int StreamingMinRadius

Category: Behavior.

Serialization: can save and load.

Tags: NotScriptable.

Pubfield StreamingPauseMode StreamingPauseMode

Category: Behavior.

Serialization: can save and load.

Tags: NotScriptable.

Pubfield int StreamingTargetRadius

Category: Behavior.

Serialization: can save and load.

Tags: NotScriptable.

Pubfield bool TemporaryLegacyPhysicsSolverOverride

If enabled, this will use the legacy physics solver (the Spring solver). This will be disabled on March 4, forcing all games to use the PGS solver.

Category: Behavior.

Serialization: cannot load or save.

Tags: NotReplicated, NotScriptable.

Pubfield Instance Terrain

A reference to the ExplorerImageIndex 65Terrain object.

Category: Behavior.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Functions

Protmethod void BreakJoints(Objects objects)

Security: PluginSecurity.

Protmethod float CalculateJumpPower(float gravity, float jumpHeight)

Security: RobloxScriptSecurity.

Protmethod bool ExperimentalSolverIsEnabled()

Security: LocalUserSecurity.

Pubmethod Tuple FindPartOnRay(Ray ray, Instance ignoreDescendantsInstance = nil, bool terrainCellsAreCubes = false, bool ignoreWater = false)

Return type is (BasePart, Vector3) if the ray hits. If it misses it will return (nil, PointAtEndOfRay).

Pubmethod Tuple FindPartOnRayWithIgnoreList(Ray ray, Objects ignoreDescendantsTable, bool terrainCellsAreCubes = false, bool ignoreWater = false)

Return type is (BasePart, Vector3) if the ray hits. If it misses it will return (nil, PointAtEndOfRay).

Pubmethod Tuple FindPartOnRayWithWhitelist(Ray ray, Objects whitelistDescendantsTable, bool ignoreWater = false)

Pubmethod Objects FindPartsInRegion3(Region3 region, Instance ignoreDescendantsInstance = nil, int maxParts = 20)

Returns parts in the area defined by the Region3, up to specified maxCount or 100, whichever is less.

Pubmethod Objects FindPartsInRegion3WithIgnoreList(Region3 region, Objects ignoreDescendantsTable, int maxParts = 20)

Returns parts in the area defined by the Region3, up to specified maxCount or 100, whichever is less.

Pubmethod Objects FindPartsInRegion3WithWhiteList(Region3 region, Objects whitelistDescendantsTable, int maxParts = 20)

Pubmethod int GetNumAwakeParts()

Returns the amount of BaseParts that are doing something.

Pubmethod int GetPhysicsThrottling()

Pubmethod double GetRealPhysicsFPS()

Pubmethod bool IsRegion3Empty(Region3 region, Instance ignoreDescendentsInstance = nil)

Whether or not the given Region3 is empty.

Pubmethod bool IsRegion3EmptyWithIgnoreList(Region3 region, Objects ignoreDescendentsTable)

Pubmethod void JoinToOutsiders(Objects objects, JointCreationMode jointType)

Joins the parts inside the table to surface jointed parts not inside the table.

Protmethod void MakeJoints(Objects objects)

Security: PluginSecurity.

Pubmethod bool PGSIsEnabled()

Protmethod void SetPhysicsThrottleEnabled(bool value)

Security: LocalUserSecurity.

Pubmethod void UnjoinFromOutsiders(Objects objects)

Unjoins the parts inside the table to surface jointed parts not inside the table.

Protmethod void ZoomToExtents()

Security: PluginSecurity.

Pubmethod Tuple findPartOnRay(Ray ray, Instance ignoreDescendantsInstance = nil, bool terrainCellsAreCubes = false, bool ignoreWater = false)

Tags: Deprecated.

Pubmethod Objects findPartsInRegion3(Region3 region, Instance ignoreDescendantsInstance = nil, int maxParts = 20)

Tags: Deprecated.


External links

Community content is available under CC-BY-SA unless otherwise noted.