Part
The base physical primitive. Exposes transform, appearance and physics properties, and touch and click events.
local part = script.ParentProperties
Name
part.Name: stringMaximum 60 characters. part.ClassName returns "Part".
Position
part.Position: Vector3World-space position of the part's center.
Size
part.Size: Vector3Dimensions in studs. Each axis is clamped to 0.25 to 1024.
Rotation
part.Rotation: Vector3Euler rotation in degrees around the X, Y and Z axes.
Color
part.Color: Color3part.Color = Color3.fromRGB(255, 80, 80)Material
part.Material: stringMaterial identifier, for example plastic, metal, wood, neon or glass.
Transparency
part.Transparency: numberRange 0 (opaque) to 1 (fully transparent).
CanCollide
part.CanCollide: booleanWhether the part collides with characters and other parts.
Anchored
part.Anchored: booleanWhen true, the part is fixed in place and excluded from physics simulation.
Velocity
part.Velocity: Vector3Linear velocity in studs per second. Applies to unanchored parts.
Mass
part.Mass: numberComputed from Size and Density. Read only.
Density
part.Density: numberRange 0.01 to 100.
Friction
part.Friction: numberRange 0 to 2.
Elasticity
part.Elasticity: numberCoefficient of restitution. Range 0 to 1.
Type
part.Type: string?Engine-handled behavior. nil for a plain part.
| Type | Behavior |
|---|---|
Kill | Kills any character that touches it. |
Damage | Applies Damage to any character that touches it. |
Seat | Seats a character on contact. |
Button | Clickable. Fires Pressed. |
Spawn | Acts as a spawn location. |
Light | Emits light. |
Door, Trigger, Scripted | No engine behavior. Used as tags by scripts. |
Damage
part.Damage: numberDamage applied on touch when Type is Damage. Range 0 to 1000.
Parent
part.Parent: Part | Model | WorldThe containing object. Assign to reparent the part under a model, another part or World.
Methods
Destroy
part:Destroy()Removes the part and all of its descendants.
Clone
part:Clone(): PartReturns a copy of the part, parented to World at the same position.
ApplyImpulse
part:ApplyImpulse(force: Vector3)Applies an instantaneous impulse to an unanchored part.
FindFirstChild
part:FindFirstChild(name: string): Instance?Returns the direct child with the given name, or nil. Children can also be indexed by name, so part.Speed.Value reads a child value named Speed.
GetChildren
part:GetChildren(): { Instance }Returns the direct children of the part.
Events
Touched
part.Touched(player: Player)Fires when a player's character begins touching the part. Does not fire again for that player until contact ends.
part.Touched:Connect(function(player)
player:SendMessage("You stepped on the pad")
end)Pressed
part.Pressed(player: Player)Fires when a player clicks the part while Type is Button. Clicks are accepted from up to 18 studs away.