Workspace
*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.
Tóm tắt
Thuộc Tính
Phương Pháp
BreakJoints(objects: Instances):() |
JoinToOutsiders(objects: Instances,jointType: Enum.JointCreationMode):() |
MakeJoints(objects: Instances):() |
UnjoinFromOutsiders(objects: Instances):() |
ZoomToExtents():() |
Sự Kiện
PersistentLoaded(player: Player):RBXScriptSignal |
Thành viên kế thừa
29 thành viên kế thừa từ WorldRoot
26 thành viên kế thừa từ Model
4 thành viên kế thừa từ PVInstance
58 thành viên kế thừa từ Instance
6 thành viên kế thừa từ Object
Tài Liệu Tham Khảo API
Thuộc Tính
Distributed Game Time
Mẫu mã
Thời Gian Chơi Phân Tán
local Workspace = game:GetService("Workspace")
print(Workspace.DistributedGameTime) -- Thời gian trò chơi bắt đầu chạy
print(os.time()) -- Thời gian kể từ thời điểm bắt đầu (1 tháng 1 năm 1970, 00:00:00) UTC
print(tick()) -- Thời gian kể từ thời điểm bắt đầu (1 tháng 1 năm 1970, 00:00:00) thời gian hệ thống
print(time()) -- Thời gian trò chơi bắt đầu chạy
print(elapsedTime()) -- Thời gian kể từ khi Roblox bắt đầu chạyFiltering Enabled
Gravity
Mẫu mã
Nút Trọng Lực Thấp
local MOON_GRAVITY_RATIO = 1.62 / 9.81
local DEFAULT_GRAVITY = 196.2
local MOON_GRAVITY = DEFAULT_GRAVITY * MOON_GRAVITY_RATIO
-- Tạo một bàn cảm ứng
local pad = Instance.new("Part")
pad.Size = Vector3.new(5, 1, 5)
pad.Position = Vector3.new(0, 0.5, 0)
pad.Anchored = true
pad.BrickColor = BrickColor.new("Bright green")
pad.Parent = workspace
-- Lắng nghe sự chạm vào bàn
local enabled = false
local debounce = false
local function onPadTouched(_hit)
if not debounce then
debounce = true
enabled = not enabled
workspace.Gravity = enabled and MOON_GRAVITY or DEFAULT_GRAVITY
pad.BrickColor = enabled and BrickColor.new("Bright red") or BrickColor.new("Bright green")
task.wait(1)
debounce = false
end
end
pad.Touched:Connect(onPadTouched)Interpolation Throttling
Pathfinding Use Improved Search
Player Character Destroy Behavior
Player Scripts Use Input Action System Alias
Rendering Cache Optimizations
Phương Pháp
Apply Recommended Streaming Settings
Break Joints
Get Real Physics FPS
Join To Outsiders
Tham Số
objects:Instances |
Lợi Nhuận
()
Make Joints
Unjoin From Outsiders
Workspace: Unjoin From Outsiders(objects:Instances):()
Tham Số
objects:Instances |
Lợi Nhuận
()
Zoom To Extents
Workspace: Zoom To Extents():()
Lợi Nhuận
()
Sự Kiện