Open Asterune
BasePart

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

Members64
Properties43
Methods19
Events2
  • TouchEnded: RBXScriptSignalparallel readread only

    Fires when contact with another part ends.

  • Touched: RBXScriptSignalparallel readread only

    Fires when another part contacts this part.

Properties

Anchored

BasePart.Anchored: boolean

Whether 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: Vector3

The angular velocity around each axis. Anchored parts are not moved by this value.

BackSurface

BasePart.BackSurface: EnumItem

The joint surface type on the back face.

BottomSurface

BasePart.BottomSurface: EnumItem

The joint surface type on the bottom face.

CFrame

BasePart.CFrame: CFrame

The part's world position and orientation. Assign a CFrame to update both together.

CanCollide

BasePart.CanCollide: boolean

Whether the part blocks other parts. Setting this to false does not hide the part or disable Touched events.

CanQuery

BasePart.CanQuery: boolean

Whether spatial queries can include this Part.

CanSeparate

BasePart.CanSeparate: boolean

Whether the geometry contains constituent Parts that can be separated.

CanTouch

BasePart.CanTouch: boolean

Whether this Part generates touch events.

CastShadow

BasePart.CastShadow: boolean

Whether this Part contributes to rendered shadows.

CenterOfMass

BasePart.CenterOfMass: Vector3

The current center of mass in world space. Read-only.

CollisionFidelity

BasePart.CollisionFidelity: Enum.CollisionFidelity

The collision approximation used for mesh geometry. Box uses bounding-box collision; Hull uses a convex hull.

CollisionGroup

BasePart.CollisionGroup: string

The collision group used to test this Part against other groups.

Color

BasePart.Color: Color3

The surface color as a Color3.

CoordinateFrame

BasePart.CoordinateFrame: CFrame

Compatibility spelling of CFrame. Use CFrame in new code.

CustomPhysicalProperties

BasePart.CustomPhysicalProperties: PhysicalProperties?

Overrides the density, friction, and elasticity supplied by Material.

Elasticity

BasePart.Elasticity: number

The restitution coefficient used for surface contact.

FaceCount

BasePart.FaceCount: number

The number of polygon faces in the mesh.

Friction

BasePart.Friction: number

The friction coefficient used for surface contact.

FrontSurface

BasePart.FrontSurface: EnumItem

The joint surface type on the front face.

GravityScale

BasePart.GravityScale: number

Multiplier applied to the gravity acceleration affecting this body.

LeftSurface

BasePart.LeftSurface: EnumItem

The joint surface type on the left face.

LinearVelocity

BasePart.LinearVelocity: Vector3

The linear velocity in studs per second.

Locked

BasePart.Locked: boolean

Whether the part can be selected in the editor. This does not affect runtime physics.

Mass

BasePart.Mass: number

The read-only mass, calculated from volume and density. Change Size, Material, or CustomPhysicalProperties to change mass.

Massless

BasePart.Massless: boolean

Whether this Part is excluded from its assembly's mass calculation when possible.

Material

BasePart.Material: EnumItem

The surface material. Material affects appearance and physical density. See Enum.Material.

MaterialSet

BasePart.MaterialSet: string

The material-set identifier used when resolving material appearance.

MaterialVariant

BasePart.MaterialVariant: string

The name of the material variant used to override the Part's base material.

Position

BasePart.Position: Vector3

The center position in world space, in studs. Assignment changes position immediately without testing the intervening path for collisions.

Reflectance

BasePart.Reflectance: number

The surface reflectivity, from 0 to 1.

RenderLayer

BasePart.RenderLayer: EnumItem

The rendering layer used for this geometry or light.

RightSurface

BasePart.RightSurface: EnumItem

The joint surface type on the right face.

Rotation

BasePart.Rotation: Vector3

The 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: EnumItem

The geometric shape used for rendering and collisions.

Size

BasePart.Size: Vector3

The dimensions along the part's local X, Y, and Z axes, in studs. Rotation does not change these dimensions.

SmoothingAngle

BasePart.SmoothingAngle: number

The angle threshold used to smooth adjacent face normals.

TextureId

BasePart.TextureId: string

The asset identifier of the mesh texture.

TopSurface

BasePart.TopSurface: EnumItem

The joint surface type on the top face.

Transparency

BasePart.Transparency: number

The transparency, from 0 (opaque) to 1 (invisible). Transparency does not disable collisions or contact events.

TriangleCount

BasePart.TriangleCount: number

The number of triangles in the mesh.

VertexCount

BasePart.VertexCount: number

The number of vertices in the mesh.

VisibilityMask

BasePart.VisibilityMask: number

Bit 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

BasePart:ApplyImpulseAtPosition(impulse: Vector3, position: Vector3): ()

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(): number

Returns the same value as Mass.

GetMesh

BasePart:GetMesh(): Mesh

Returns 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(): boolean

Returns 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

BasePart:GetVelocityAtPosition(position: Vector3): Vector3

Returns the velocity at a world-space position, including linear and angular motion.

Intersect

BasePart:Intersect(parts: { BasePart }): BasePart

Keeps only the volume shared by this geometry and the supplied geometry.

MakeEditable

BasePart:MakeEditable(): Mesh

Returns 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 }): BasePart

Removes the supplied geometry from this geometry using a solid difference.

Union

BasePart:Union(parts: { BasePart }): BasePart

Combines this geometry with the supplied geometry using a solid union.

Events

TouchEnded

BasePart.TouchEnded: RBXScriptSignal

Fires when contact with another part ends. Passes the other part.

Touched

BasePart.Touched: RBXScriptSignal

Fires 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

Inherited47

Examples

Luau
local part = Instance.new("Part")
part.Anchored = true
part.CanCollide = false
part.Parent = workspace
Luau
-- 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

Part · Vector3 · CFrame · Enum.Material · Enum.SurfaceType