BasePart
Defines physical properties, transforms, and contact events for parts.
- Not creatable
- Created by the engine or used as a base class.
- Inherits
- PVInstanceInstance
- Replication
- Standard
Behavior
BasePart is the abstract base class for physical parts. Create a concrete
class such as Part. Unanchored parts are moved by physics.
Summary
Whether physics can move the part.
The angular velocity around each axis.
The joint surface type on the back face.
The joint surface type on the bottom face.
The part's world position and orientation.
Whether the part blocks other parts.
Whether spatial queries can include this Part.
Whether the geometry contains constituent Parts that can be separated.
Whether this Part generates touch events.
Whether this Part contributes to rendered shadows.
The current center of mass in world space.
The collision approximation used for mesh geometry.
The collision group used to test this Part against other groups.
The surface color as a Color3.
Compatibility spelling of CFrame.
Overrides the density, friction, and elasticity supplied by Material.
The restitution coefficient used for surface contact.
The number of polygon faces in the mesh.
The friction coefficient used for surface contact.
The joint surface type on the front face.
Multiplier applied to the gravity acceleration affecting this body.
The joint surface type on the left face.
The linear velocity in studs per second.
Whether the part can be selected in the editor.
The read-only mass, calculated from volume and density.
Whether this Part is excluded from its assembly's mass calculation when possible.
The surface material.
The material-set identifier used when resolving material appearance.
The name of the material variant used to override the Part's base material.
The center position in world space, in studs.
The surface reflectivity, from 0 to 1.
The rendering layer used for this geometry or light.
The joint surface type on the right face.
The orientation as X, Y, and Z angles in degrees.
The geometric shape used for rendering and collisions.
The dimensions along the part's local X, Y, and Z axes, in studs.
The angle threshold used to smooth adjacent face normals.
The asset identifier of the mesh texture.
The joint surface type on the top face.
The transparency, from 0 (opaque) to 1 (invisible).
The number of triangles in the mesh.
The number of vertices in the mesh.
Bit mask used with a camera's culling mask to determine visibility.
Applies an instantaneous angular impulse to the Part's rigid body.
Applies an instantaneous linear impulse to the Part's rigid body.
Applies an impulse at a world-space position.
Returns the contact points recorded for this Part by the physics simulation.
Returns this instance if it is an ExecutionGroup.
Returns the same value as Mass.
Returns the Part's polygon mesh.
Returns the player assigned to simulate the Part, or nil for server ownership.
Returns whether the engine selects simulation ownership automatically.
Returns parts recorded in the latest physics contact diagnostics.
Returns the velocity at a world-space position, including linear and angular motion.
Keeps only the volume shared by this geometry and the supplied geometry.
Returns an editable Mesh for the Part's geometry.
Separates the result into its constituent Parts.
Replaces the Part's polygon mesh with the supplied Mesh.
Assigns simulation ownership to a player.
Enables automatic simulation ownership selection.
Removes the supplied geometry from this geometry using a solid difference.
Combines this geometry with the supplied geometry using a solid union.
Fires when contact with another part ends.
Fires when another part contacts this part.
Properties
Anchored
BasePart.Anchored: booleanWhether physics can move the part. Anchored parts can still be moved by scripts. Unanchored parts fall under gravity and are removed below Workspace.FallenPartsDestroyHeight.
AngularVelocity
BasePart.AngularVelocity: Vector3The angular velocity around each axis. Anchored parts are not moved by this value.
BackSurface
BasePart.BackSurface: EnumItemThe joint surface type on the back face.
BottomSurface
BasePart.BottomSurface: EnumItemThe joint surface type on the bottom face.
CFrame
BasePart.CFrame: CFrameThe part's world position and orientation. Assign a CFrame to update both together.
CanCollide
BasePart.CanCollide: booleanWhether the part blocks other parts. Setting this to false does not hide the part or disable Touched events.
CanQuery
BasePart.CanQuery: booleanWhether spatial queries can include this Part.
CanSeparate
BasePart.CanSeparate: booleanWhether the geometry contains constituent Parts that can be separated.
CanTouch
BasePart.CanTouch: booleanWhether this Part generates touch events.
CastShadow
BasePart.CastShadow: booleanWhether this Part contributes to rendered shadows.
CenterOfMass
BasePart.CenterOfMass: Vector3The current center of mass in world space. Read-only.
CollisionFidelity
BasePart.CollisionFidelity: Enum.CollisionFidelityThe collision approximation used for mesh geometry. Box uses bounding-box collision; Hull uses a convex hull.
CollisionGroup
BasePart.CollisionGroup: stringThe collision group used to test this Part against other groups.
Color
BasePart.Color: Color3The surface color as a Color3.
CoordinateFrame
BasePart.CoordinateFrame: CFrameCompatibility spelling of CFrame. Use CFrame in new code.
CustomPhysicalProperties
BasePart.CustomPhysicalProperties: PhysicalProperties?Overrides the density, friction, and elasticity supplied by Material.
Elasticity
BasePart.Elasticity: numberThe restitution coefficient used for surface contact.
FaceCount
BasePart.FaceCount: numberThe number of polygon faces in the mesh.
Friction
BasePart.Friction: numberThe friction coefficient used for surface contact.
FrontSurface
BasePart.FrontSurface: EnumItemThe joint surface type on the front face.
GravityScale
BasePart.GravityScale: numberMultiplier applied to the gravity acceleration affecting this body.
LeftSurface
BasePart.LeftSurface: EnumItemThe joint surface type on the left face.
LinearVelocity
BasePart.LinearVelocity: Vector3The linear velocity in studs per second.
Locked
BasePart.Locked: booleanWhether the part can be selected in the editor. This does not affect runtime physics.
Mass
BasePart.Mass: numberThe read-only mass, calculated from volume and density. Change Size, Material, or CustomPhysicalProperties to change mass.
Massless
BasePart.Massless: booleanWhether this Part is excluded from its assembly's mass calculation when possible.
Material
BasePart.Material: EnumItemThe surface material. Material affects appearance and physical density. See Enum.Material.
MaterialSet
BasePart.MaterialSet: stringThe material-set identifier used when resolving material appearance.
MaterialVariant
BasePart.MaterialVariant: stringThe name of the material variant used to override the Part's base material.
Position
BasePart.Position: Vector3The center position in world space, in studs. Assignment changes position immediately without testing the intervening path for collisions.
Reflectance
BasePart.Reflectance: numberThe surface reflectivity, from 0 to 1.
RenderLayer
BasePart.RenderLayer: EnumItemThe rendering layer used for this geometry or light.
RightSurface
BasePart.RightSurface: EnumItemThe joint surface type on the right face.
Rotation
BasePart.Rotation: Vector3The orientation as X, Y, and Z angles in degrees. Multiple angle combinations can represent the same orientation, so reading this property may return different angles from those assigned.
Shape
BasePart.Shape: EnumItemThe geometric shape used for rendering and collisions.
Size
BasePart.Size: Vector3The dimensions along the part's local X, Y, and Z axes, in studs. Rotation does not change these dimensions.
SmoothingAngle
BasePart.SmoothingAngle: numberThe angle threshold used to smooth adjacent face normals.
TextureId
BasePart.TextureId: stringThe asset identifier of the mesh texture.
TopSurface
BasePart.TopSurface: EnumItemThe joint surface type on the top face.
Transparency
BasePart.Transparency: numberThe transparency, from 0 (opaque) to 1 (invisible). Transparency does not disable collisions or contact events.
TriangleCount
BasePart.TriangleCount: numberThe number of triangles in the mesh.
VertexCount
BasePart.VertexCount: numberThe number of vertices in the mesh.
VisibilityMask
BasePart.VisibilityMask: numberBit mask used with a camera's culling mask to determine visibility.
Methods
ApplyAngularImpulse
BasePart:ApplyAngularImpulse(impulse: Vector3): ()Applies an instantaneous angular impulse to the Part's rigid body.
ApplyImpulse
BasePart:ApplyImpulse(impulse: Vector3): ()Applies an instantaneous linear impulse to the Part's rigid body.
ApplyImpulseAtPosition
Applies an impulse at a world-space position. An off-center impulse can also change angular velocity.
GetContacts
BasePart:GetContacts(): { ContactPoint }Returns the contact points recorded for this Part by the physics simulation.
GetExecutionGroup
BasePart:GetExecutionGroup(): ExecutionGroup?Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.
GetMass
BasePart:GetMass(): numberReturns the same value as Mass.
GetMesh
BasePart:GetMesh(): MeshReturns the Part's polygon mesh.
GetNetworkOwner
BasePart:GetNetworkOwner(): Player?Returns the player assigned to simulate the Part, or nil for server ownership.
GetNetworkOwnershipAuto
BasePart:GetNetworkOwnershipAuto(): booleanReturns whether the engine selects simulation ownership automatically.
GetTouchingParts
BasePart:GetTouchingParts(): { BasePart }Returns parts recorded in the latest physics contact diagnostics. Returns an empty array when no contact record is available. This is a contact query; use Workspace.OverlapBox or OverlapSphere for spatial overlap queries.
GetVelocityAtPosition
Returns the velocity at a world-space position, including linear and angular motion.
Intersect
BasePart:Intersect(parts: { BasePart }): BasePartKeeps only the volume shared by this geometry and the supplied geometry.
MakeEditable
BasePart:MakeEditable(): MeshReturns an editable Mesh for the Part's geometry.
Separate
BasePart:Separate(): { BasePart }Separates the result into its constituent Parts.
SetMesh
BasePart:SetMesh(mesh: Mesh): ()Replaces the Part's polygon mesh with the supplied Mesh.
SetNetworkOwner
BasePart:SetNetworkOwner(playerInstance: Player?): ()Assigns simulation ownership to a player. Pass nil for server ownership.
SetNetworkOwnershipAuto
BasePart:SetNetworkOwnershipAuto(): ()Enables automatic simulation ownership selection.
Subtract
BasePart:Subtract(parts: { BasePart }): BasePartRemoves the supplied geometry from this geometry using a solid difference.
Union
BasePart:Union(parts: { BasePart }): BasePartCombines this geometry with the supplied geometry using a solid union.
Events
TouchEnded
BasePart.TouchEnded: RBXScriptSignalFires when contact with another part ends. Passes the other part.
Touched
BasePart.Touched: RBXScriptSignalFires when another part contacts this part. Passes the contacting part. Contact can produce repeated events, and a character can trigger separate events for multiple body parts. Add a guard or cooldown when an action must run only once per contact or character.
Inherited members
- Properties
- ArchivableClassNameNameParent
- Methods
- AddComponent()AddTag()ClearAllChildren()ClearTags()Clone()Destroy()FindFirstAncestor()FindFirstAncestorOfClass()FindFirstAncestorWhichIsA()FindFirstChild()FindFirstChildOfClass()FindFirstChildWhichIsA()FindFirstDescendant()GetAttribute()GetAttributeChangedSignal()GetAttributes()GetChildren()GetComponent()GetComponentChangedSignal()GetComponents()GetDebugId()GetDescendants()GetFullName()GetPropertyChangedSignal()GetReferencing()GetTags()HasComponent()HasTag()IsA()IsAncestorOf()IsDescendantOf()RemoveComponent()RemoveTag()SetAttribute()WaitForChild()
- Events
- AncestryChangedAttributeChangedChangedChildAddedChildRemovedDescendantAddedDescendantRemovingDestroying
Examples
local part = Instance.new("Part")
part.Anchored = true
part.CanCollide = false
part.Parent = workspace-- Server Script under an anchored trigger Part with CanCollide set to false.
local zone = script.Parent
local lastHit = setmetatable({}, { __mode = "k" })
zone.Touched:Connect(function(hit)
local character = hit.Parent
local humanoid = character and character:FindFirstChild("Humanoid")
if not humanoid then
return
end
local now = workspace.DistributedGameTime
if lastHit[character] and now - lastHit[character] < 1 then
return
end
lastHit[character] = now
humanoid:TakeDamage(15)
end)Subclasses
GeometryPart · Part · Seat · Terrain · TriangleMeshPart · VehicleSeat
Related APIs
Part · Vector3 · CFrame · Enum.Material · Enum.SurfaceType