Workspace (工作区)

Workspace (工作区) 是游戏中所有物理部分存在的主要区域。这包括玩家可以看到和交互的物体,如角色、建筑物、工具和其他项目。

它像是游戏的“世界”,包含构成游戏的所有项目和环境。服务器和玩家的电脑(客户端)都可以看到和互动 Workspace (工作区) 中的物体。

Image 1
Roblox Studio
local workspace = game:GetService("Workspace")

local cube = workspace:FindFirstChild("Cube")

if cube and cube:IsA("Part") then
    print("Found the part named 'Cube'")
    cube.BrickColor = BrickColor.new("Bright red")
else
    print("Part named 'Cube' not found in the workspace or it is not a Part")
end
Image 1
Image 2
Roblox Studio

如果您觉得本教程对您有帮助,并且愿意支持我的工作,请考虑请我喝杯咖啡。

非常感谢您的支持!

请我喝咖啡