Part

顯示已棄用項目

*此內容很快就會推出您所選的語言版本。

The Part object is a type of BasePart. It comes in five different primitive shapes: Ball, Block, Cylinder, Wedge, and CornerWedge.

範例程式碼

Create a Part in a Script

local part = Instance.new("Part")
part.Name = "JurassicPart"
part.Anchored = true
part.Shape = Enum.PartType.Ball
part.Color = Color3.new(1, 1, 1)
part.Parent = workspace -- Put the part into the Workspace

概要

屬性

屬性 繼承自 BasePart屬性 繼承自 PVInstance

方法

方法 繼承自 BasePart方法 繼承自 PVInstance

活動

活動 繼承自 BasePart

屬性

未複製
平行讀取

The Shape property sets the overall shape of the object to one of a predetermined list of built-in shapes.

The Enum.PartType enum controls the shape value, and has five possible shapes:

Shape/ValueDescription
BallA spherical shape.
BlockA block shape.
CylinderA cylinder shape.
WedgeA wedge shape with a slope on one side.
CornerWedgeA wedge shape with slopes on two sides.

MeshPart and solid modeling can be used to obtain completely custom part shapes.

Collisions between balls, blocks, and wedges, and corner wedges are exact, whereas collisions between terrain, cylinders, TriangleMeshes, and other geometry types are approximations. This means that the ball shape can be useful to create stable colliders for car wheels.

範例程式碼

Create a Part in a Script

local part = Instance.new("Part")
part.Name = "JurassicPart"
part.Anchored = true
part.Shape = Enum.PartType.Ball
part.Color = Color3.new(1, 1, 1)
part.Parent = workspace -- Put the part into the Workspace

方法

活動