Skip to Content

Part

The base physical primitive. Exposes transform, appearance and physics properties, and touch and click events.

local part = script.Parent

Properties

Name

part.Name: string

Maximum 60 characters. part.ClassName returns "Part".

Position

part.Position: Vector3

World-space position of the part's center.

Size

part.Size: Vector3

Dimensions in studs. Each axis is clamped to 0.25 to 1024.

Rotation

part.Rotation: Vector3

Euler rotation in degrees around the X, Y and Z axes.

Color

part.Color: Color3
part.Color = Color3.fromRGB(255, 80, 80)

Material

part.Material: string

Material identifier, for example plastic, metal, wood, neon or glass.

Transparency

part.Transparency: number

Range 0 (opaque) to 1 (fully transparent).

CanCollide

part.CanCollide: boolean

Whether the part collides with characters and other parts.

Anchored

part.Anchored: boolean

When true, the part is fixed in place and excluded from physics simulation.

Velocity

part.Velocity: Vector3

Linear velocity in studs per second. Applies to unanchored parts.

Mass

part.Mass: number

Computed from Size and Density. Read only.

Density

part.Density: number

Range 0.01 to 100.

Friction

part.Friction: number

Range 0 to 2.

Elasticity

part.Elasticity: number

Coefficient of restitution. Range 0 to 1.

Type

part.Type: string?

Engine-handled behavior. nil for a plain part.

TypeBehavior
KillKills any character that touches it.
DamageApplies Damage to any character that touches it.
SeatSeats a character on contact.
ButtonClickable. Fires Pressed.
SpawnActs as a spawn location.
LightEmits light.
Door, Trigger, ScriptedNo engine behavior. Used as tags by scripts.

Damage

part.Damage: number

Damage applied on touch when Type is Damage. Range 0 to 1000.

Parent

part.Parent: Part | Model | World

The 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(): Part

Returns 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.

On this page