Workspace

Workspace : WorldRoot

Overview

The provided code defines the Workspace class, a subclass of WorldRoot, for managing a Lua-based workspace in Unreal Engine. It includes properties like gravity, max slope angle, and default player settings. The class handles child and descendant additions/removals, property changes, replication, and uses Lua scripting for certain functionalities. Users can get or set properties such as gravity, max slope angle, manage spawn locations, cameras, and access the CurrentCamera object used by local players. Workspace is marked as a non-creatable service within the LUA API context for Un

Description

Workspace is a core component in Overdare Studio's Lua scripting environment, serving as the primary workspace for developers and users to create, manage, and run Lua-based projects. It inherits from WorldRoot and manages various aspects of gameplay such as gravity, max slope angle, camera control, and player movement settings. In Overdare Studio's structure, it acts as a central hub for organizing and managing elements during game creation using Lua scripting capabilities. It provides access to essential properties and supports configuration options to create immersive experiences for players.

Properties

Gravity

number

Gravity is a fundamental force that attracts two objects with mass toward each other, causing them to fall towards the center of a planet or accelerate towards one another with varying levels of strength depending on their masses and distance. This force primarily affects falling and moving objects within various simulation environments, including those managed by Workspace, LuaWorkspaces, and game development platforms using Lua. Gravity is often represented as an acceleration value that influences the behavior of virtual objects in simulations or BaseParts in specific programming contexts.

Code Samples

local Workspace = game:GetService("Workspace")
Workspace.Gravity = 10000

MaxSlopeAngle

number

MaxSlopeAngle is a property or value representing the maximum angle at which surfaces can slope before becoming unclimbable, non-walkable, too steep, or inaccessible for characters and objects within various Lua workspaces. This property impacts gameplay, movement mechanics, object interactions, and terrain design across different environments. Its specific usage depends on the context of each Lua workspace implementation.

Code Samples

//NotWork//

Methods

GetServerTimeNow

This method returns the current server time as a number. The server time is typically used for synchronization purposes. It provides an accurate and consistent time reference for various in-game actions or events.

Parameters

Return

number

Code Samples

local Workspace = game:GetService("Workspace")

print(Workspace:GetServerTimeNow())

Events