Reference API Roblox

Engine API

Website

Related

Reference API Roblox

BasePart

The abstract base class for in-world objects that physically interact.

This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is not browsable. It is not visible in Studio's object browser.
Tags: [NotCreatable, NotBrowsable]

Member index 118

HistoryMember
553Anchored: bool
553AssemblyAngularVelocity: Vector3
553AssemblyCenterOfMass: Vector3
553AssemblyLinearVelocity: Vector3
553AssemblyMass: float
553AssemblyRootPart: BasePart
652AudioCanCollide: bool
553BackSurface: SurfaceType
553BottomSurface: SurfaceType
553BrickColor: BrickColor
553CFrame: CFrame
553CanCollide: bool
553CanQuery: bool
553CanTouch: bool
553CastShadow: bool
553CenterOfMass: Vector3
553CollisionGroup: string
574CollisionGroupId: int
553Color: Color3
553CurrentPhysicalProperties: PhysicalProperties
553CustomPhysicalProperties: PhysicalProperties
581EnableFluidForces: bool
553ExtentsCFrame: CFrame
553ExtentsSize: Vector3
553FrontSurface: SurfaceType
553LeftSurface: SurfaceType
553Locked: bool
553Mass: float
553Massless: bool
553Material: Material
553MaterialVariant: string
553PivotOffset: CFrame
553Reflectance: float
553ResizeIncrement: int
553ResizeableFaces: Faces
553RightSurface: SurfaceType
553RootPriority: int
553Rotation: Vector3
553Size: Vector3
553SpecificGravity: float
553TopSurface: SurfaceType
553Transparency: float
553brickColor: BrickColor
603AngularAccelerationToTorque(angAcceleration: Vector3, angVelocity: Vector3 = 0, 0, 0): Vector3
573ApplyAngularImpulse(impulse: Vector3): null
573ApplyImpulse(impulse: Vector3): null
573ApplyImpulseAtPosition(impulse: Vector3, position: Vector3): null
573BreakJoints(): null
557CanCollideWith(part: BasePart): bool
462CanSetNetworkOwnership(): Tuple
576GetClosestPointOnSurface(position: Vector3): Vector3
648GetConnectedParts(recursive: bool = false): Instances
648GetJoints(): Instances
486GetMass(): float
567GetNetworkOwner(): Instance
567GetNetworkOwnershipAuto(): bool
648GetNoCollisionConstraints(): Instances
462GetRenderCFrame(): CFrame
486GetRootPart(): Instance
648GetTouchingParts(): Instances
557GetVelocityAtPosition(position: Vector3): Vector3
648IntersectAsync(parts: Instances, collisionfidelity: CollisionFidelity = Default, renderFidelity: RenderFidelity = Automatic): Instance
486IsGrounded(): bool
573MakeJoints(): null
462Resize(normalId: NormalId, deltaAmount: int): bool
573SetNetworkOwner(playerInstance: Player = Player): null
573SetNetworkOwnershipAuto(): null
648SubtractAsync(parts: Instances, collisionfidelity: CollisionFidelity = Default, renderFidelity: RenderFidelity = Automatic): Instance
603TorqueToAngularAcceleration(torque: Vector3, angVelocity: Vector3 = 0, 0, 0): Vector3
648UnionAsync(parts: Instances, collisionfidelity: CollisionFidelity = Default, renderFidelity: RenderFidelity = Automatic): Instance
573breakJoints(): null
641getMass(): float
573makeJoints(): null
553resize(normalId: NormalId, deltaAmount: int): bool
483LocalSimulationTouched(part: BasePart)
462OutfitChanged()
553StoppedTouching(otherPart: BasePart)
483TouchEnded(otherPart: BasePart)
483Touched(otherPart: BasePart)
inherited from PVInstance
553Origin: CFrame
553Pivot Offset: CFrame
576GetPivot(): CFrame
573PivotTo(targetCFrame: CFrame): null
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 14

HistoryMember
452BodyAngularVelocity: Vector3
452BodyCenterOfMass: Vector3
452BodyLinearVelocity: Vector3
452BodyMass: float
452LinearVelocity: Vector3
352Negate(): Instance
352Separate(): Objects
352UnionWith(part: Instance): Instance
588subtractAsync2_INTERNAL(parts: Objects, collisionfidelity: CollisionFidelity = Default, renderFidelity: RenderFidelity = Automatic): Objects
588unionAsync2_INTERNAL(parts: Objects, collisionfidelity: CollisionFidelity = Default, renderFidelity: RenderFidelity = Automatic): Objects
480touched(otherPart: Instance)

Description

BasePart is an abstract base class for in-world objects that render and are physically simulated while in the Workspace. There are several implementations of BasePart, the most common being Part and MeshPart. Others include WedgePart, SpawnLocation, and the singleton Terrain object. Generally, when documentation refers to a "part," most BasePart implementations will work and not just Part.

For information on how BaseParts are grouped into simulated rigid bodies, see Assemblies.

There are many different objects that interact with BasePart (other than Terrain), including:

History 507

Members 118

Anchored

TypeDefault
bool

The Anchored property determines whether the part will be immovable by physics. When enabled, a part will never change position due to gravity, other part collisions, overlapping other parts, or any other physics-related causes. As a result, two anchored parts will never fire the BasePart.Touched event on each other.

An anchored part may still be moved by changing its CFrame or Position, and it still may have a nonzero AssemblyLinearVelocity and AssemblyAngularVelocity.

Finally, if an unanchored part is joined with an anchored part through an object like a Weld, it too will act anchored. If such a joint breaks, the part may be affected by physics again. See Assemblies for more details.

Network ownership cannot be set on anchored parts. If a part's anchored status changes on the server, the network ownership of that part will be affected.

History 5

AngularAccelerationToTorque

Parameters (2)Default
angAccelerationVector3
angVelocityVector30, 0, 0
Returns (1)
Vector3

History 1

ApplyAngularImpulse

Parameters (1)
impulseVector3
Returns (1)
null

Applies an instant angular force impulse to this part's assembly, causing the assembly to spin.

The resulting angular velocity from the impulse relies on the assembly's mass. So a higher impulse is required to move more massive assemblies. Impulses are useful for cases where you want a force applied instantly, such as an explosion or collision.

If the part is owned by the server, this function must be called from a server Script (not from a LocalScript or a Script with RunContext set to RunContext.Client). If the part is owned by a client through automatic ownership, this function can be called from either a client script or a server script; calling it from a client script for a server-owned part will have no effect.

History 5

ApplyImpulse

Parameters (1)
impulseVector3
Returns (1)
null

This function applies an instant force impulse to this part's assembly.

The force is applied at the assembly's center of mass, so the resulting movement will only be linear.

The resulting velocity from the impulse relies on the assembly's mass. So a higher impulse is required to move more massive assemblies. Impulses are useful for cases where you want a force applied instantly, such as an explosion or collision.

If the part is owned by the server, this function must be called from a server Script (not from a LocalScript or a Script with RunContext set to RunContext.Client). If the part is owned by a client through automatic ownership, this function can be called from either a client script or a server script; calling it from a client script for a server-owned part will have no effect.

History 5

ApplyImpulseAtPosition

Parameters (2)
impulseVector3
positionVector3
Returns (1)
null

This function applies an instant force impulse to this part's assembly, at the specified position in world space.

If the position is not at the assembly's center of mass, the impulse will cause a positional and rotational movement.

The resulting velocity from the impulse relies on the assembly's mass. So a higher impulse is required to move more massive assemblies. Impulses are useful for cases where developers want a force applied instantly, such as an explosion or collision.

If the part is owned by the server, this function must be called from a server Script (not from a LocalScript or a Script with RunContext set to RunContext.Client). If the part is owned by a client through automatic ownership, this function can be called from either a client script or a server script; calling it from a client script for a server-owned part will have no effect.

History 5

AssemblyAngularVelocity

TypeDefault
Vector3

The angular velocity vector of this part's assembly. It's the rate of change of orientation in radians per second.

Angular velocity is the same at every point of the assembly.

Setting the velocity directly may lead to unrealistic motion. Using Torque or AngularVelocity constraint is preferred, or use BasePart:ApplyAngularImpulse() if you want instantaneous change in velocity.

If the part is owned by the server, this property must be changed from a server Script (not from a LocalScript or a Script with RunContext set to RunContext.Client). If the part is owned by a client through automatic ownership, this property can be changed from either a client script or a server script; changing it from a client script for a server-owned part will have no effect.

This property is not replicated. Its interface does not cross the network boundary.

History 5

Tags: [NotReplicated]

AssemblyCenterOfMass

TypeDefault
Vector3

A position calculated via the mass and position of all the parts in the assembly.

If the assembly has an anchored part, that part's center of mass will be the assembly's center of mass, and the assembly will have infinite mass.

Knowing the center of mass can help the assembly maintain stability. A force applied to the center of mass will not cause angular acceleration, only linear. An assembly with a low center of mass will have a better time staying upright under the effect of gravity.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 5

Tags: [ReadOnly, NotReplicated]

AssemblyLinearVelocity

TypeDefault
Vector3

The linear velocity vector of this part's assembly. It's the rate of change in position of the assembly's center of mass in studs per second.

If you want to know the velocity at a point other than the assembly's center of mass, use BasePart:GetVelocityAtPosition().

Setting the velocity directly may lead to unrealistic motion. Using a VectorForce constraint is preferred, or use BasePart:ApplyImpulse() if you want instantaneous change in velocity.

If the part is owned by the server, this property must be changed from a server Script (not from a LocalScript or a Script with RunContext set to RunContext.Client). If the part is owned by a client through automatic ownership, this property can be changed from either a client script or a server script; changing it from a client script for a server-owned part will have no effect.

This property is not replicated. Its interface does not cross the network boundary.

History 5

Tags: [NotReplicated]

AssemblyMass

TypeDefault
float

The sum of the mass of all the parts in this part's assembly. Parts that are Massless and are not the assembly's root part will not contribute to the AssemblyMass.

If the assembly has an anchored part, the assembly's mass is considered infinite. Constraints and other physical interactions between unanchored assemblies with a large difference in mass may cause instabilities.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 5

Tags: [ReadOnly, NotReplicated]

AssemblyRootPart

TypeDefault
BasePart

This property indicates the BasePart automatically chosen to represent the assembly's root part. It is the same part that's returned when developers call GetRootPart().

The root part can be changed by changing the RootPriority of the parts in the assembly.

Parts that all share the same AssemblyRootPart are in the same assembly.

For more information on root parts, see Assemblies.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 5

Tags: [ReadOnly, NotReplicated]

AudioCanCollide

TypeDefault
bool

History 1

BackSurface

TypeDefault
SurfaceType

The BackSurface property determines the type of surface used for the +Z direction of a part. When two parts' faces are placed next to each other, they may create a joint between them. If set to Motor, the BasePart.BackSurfaceInput determines how a motor joint should behave.

Most SurfaceTypes render a texture on the part face if the BasePart.Material is set to Plastic. Some SurfaceTypes - Hinge, Motor and SteppingMotor - will render a 3D adornment instead. If this property is selected in the Properties window, it will be highlighted in the game world similar to that of a SurfaceSelection.

History 4

BottomSurface

TypeDefault
SurfaceType

The BottomSurface property determines the type of surface used for the -Y direction of a part. When two parts' faces are placed next to each other, they may create a joint between them. If set to Motor, the BasePart.BottomSurfaceInput determines how a motor joint should behave.

Most SurfaceTypes render a texture on the part face if the BasePart.Material is set to Plastic. Some SurfaceTypes - Hinge, Motor and SteppingMotor - will render a 3D adornment instead. If this property is selected in the Properties window, it will be highlighted in the game world similar to that of a SurfaceSelection.

History 4

BreakJoints

Parameters (0)
No parameters.
Returns (1)
null

Breaks any surface connection with any adjacent part, including Weld and other JointInstance.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 4

Tags: [Deprecated]

BrickColor

TypeDefault
BrickColor

The BrickColor property determines the color of a part. If the part has a BasePart.Material, this also determines the color used when rendering the material texture. For more control over the color, the BasePart.Color property can be used (it is a Color3 variant of this property). If Color set, this property will use the closest BrickColor.

Other visual properties of a part are determined by BasePart.Transparency and BasePart.Reflectance.

This property is not replicated. Its interface does not cross the network boundary.

History 4

Tags: [NotReplicated]

CFrame

TypeDefault
CFrame

The CFrame property determines both the position and orientation of the BasePart in the world. It acts as an arbitrary reference location on the geometry, but ExtentsCFrame represents the actual CFrame of its physical center.

When setting CFrame on a part, other joined parts are also moved relative to the part, but it is recommended that you use PVInstance:PivotTo() to move an entire model, such as when teleporting a player's character.

Unlike setting BasePart.Position, setting BasePart.CFrame will always move the part to the exact given CFrame; in other words: no overlap checking is done and the physics solver will attempt to resolve any overlap unless both parts are Anchored.

For keeping track of positions relative to a part's CFrame, an Attachment may be useful.

History 5

CanCollide

TypeDefault
bool

CanCollide determines whether a part will physically interact with other parts. When disabled, other parts can pass through the brick uninterrupted. Parts used for decoration usually have CanCollide disabled, as they need not be considered by the physics engine.

If a part is not BasePart.Anchored and has CanCollide disabled, it may fall out of the world to be eventually destroyed by Workspace.FallenPartsDestroyHeight.

When CanCollide is disabled, parts may still fire the BasePart.Touched event (as well the other parts touching them). You can disable this with BasePart.CanTouch.

For more information on collisions, see Collisions.

History 5

CanCollideWith

Parameters (1)
partBasePart
Returns (1)
bool

Returns whether the parts can collide with each other or not. This function takes into account the collision groups of the two parts. This function will error if the specified part is not a BasePart.

History 4

CanQuery

TypeDefault
bool

CanQuery determines whether the part is considered during spatial query operations, such as GetPartBoundsInBox or Raycast. CanCollide must also be disabled when disabling CanQuery. These functions will never include parts whose CanQuery and CanCollide is false.

Beyond this property, it is also possible to exclude parts which are descendants of a given list of parts using an OverlapParams or RaycastParams object when calling the spatial query functions.

History 3

CanSetNetworkOwnership

Parameters (0)
No parameters.
Returns (1)
Tuple

The CanSetNetworkOwnership function checks whether you can set a part's network ownership.

The function's return value verifies whether or not you can call BasePart:SetNetworkOwner() or BasePart:SetNetworkOwnershipAuto() without encountering an error. It returns true if you can modify/read the network ownership, or returns false and the reason you can't, as a string.

History 2

CanTouch

TypeDefault
bool

This property determines if Touched and TouchEnded events fire on the part. If true, other touching parts must also have CanTouch set to true for touch events to fire. If false, touch events cannot be set up for the part and attempting to do so will throw an error. Similarly, if the property is set to false after a touch event is connected, the event will be disconnected and the TouchTransmitter removed.

Note that this collision logic can be set to respect collision groups through the Workspace.TouchesUseCollisionGroups property. If true, parts in non-colliding groups will ignore both collisions and touch events, thereby making this property irrelevant.

Performance

There is a small performance gain on parts that have both CanTouch and CanCollide set to false, as these parts will never need to compute any kind of part to part collisions. However, they can still be hit by Raycasts and OverlapParams queries.

History 6

CastShadow

TypeDefault
bool

Determines whether or not a part casts a shadow.

Note that this feature is not designed for performance enhancement. It should only be disabled on parts where you want to hide the shadows the part casts. Disabling this property for a given part may cause visual artifacts on the shadows cast upon that part.

History 4

CenterOfMass

TypeDefault
Vector3

The CenterOfMass property describes the local position of a part's center of mass. If this is a single part assembly, this is the AssemblyCenterOfMass converted from world space to local. On simple Parts, the center of mass is always (0,0,0). It can vary for WedgePart or MeshPart however.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 5

Tags: [ReadOnly, NotReplicated]

CollisionGroup

TypeDefault
string

The CollisionGroup property describes the name of the part's collision group (maximum of 100 characters). Parts start off in the default group whose name is "Default". This value cannot be empty.

Although this property itself is non-replicated, the engine internally replicates the value through another private property to solve backward compatibility issues.

This property is not replicated. Its interface does not cross the network boundary.

History 6

Tags: [NotReplicated]

CollisionGroupId

TypeDefault
int

The BasePart.CollisionGroupId property describes the ID number of the part's collision group. Parts start off in the "Default" group whose ID is 0. If a part is unregistered, the value becomes -1. This value cannot be less than -1 and it cannot exceed PhysicsService:GetMaxCollisionGroups(). Invalid IDs are clamped.

Although this property can be directly changed, it's recommended that you specify the collision group by setting BasePart.CollisionGroup to the collision group's name.

This property is deprecated. It exists only for backward compatibility, and should not be used for new work. CollisionGroup should be used instead.
This property is not replicated. Its interface does not cross the network boundary.

History 8

Tags: [NotReplicated, Deprecated]

Color

TypeDefault
Color3

The Color property determines the color of a part. If the part has a BasePart.Material, this also determines the color used when rendering the material texture. If this property is set, BasePart.BrickColor will use the closest BrickColor to the Color3 value.

Other visual properties of a part are determined by BasePart.Transparency and BasePart.Reflectance.

This property is not replicated. Its interface does not cross the network boundary.

History 5

  • 553 Change Default of Color from to
  • 486 Change ThreadSafety of Color from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of Color from to ReadOnly
  • 292 Change Tags of Color from [NotReplicated, Deprecated] to [NotReplicated]
  • 47 Add Color
Tags: [NotReplicated]

CurrentPhysicalProperties

TypeDefault
PhysicalProperties

CurrentPhysicalProperties indicates the current physical properties of the part. You can set custom values for the physical properties per part, custom material, and material override. The Engine prioritizes more granular definitions when determining the effective physical properties of a part. The values in the following list are in order from highest to lowest priority:

  • Custom physical properties of the part
  • Custom physical properties of the part's custom material
  • Custom physical properties of the material override of the part's material
  • Default physical properties of the part's material
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly, NotReplicated]

CustomPhysicalProperties

TypeDefault
PhysicalProperties

CustomPhysicalProperties lets you customize various physical aspects of a Part, such as its density, friction, and elasticity.

If enabled, this property let's you configure these physical properties. If disabled, these physical properties are determined by the BasePart.Material of the part. The page for Material contains list of the various part materials.

History 5

EnableFluidForces

TypeDefault
bool

When true, and when Workspace.FluidForces is enabled, causes the physics engine to compute aerodynamic forces on this BasePart.

History 1

ExtentsCFrame

TypeDefault
CFrame

The CFrame of the physical extents of the BasePart, representing its physical center.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly, NotReplicated]

ExtentsSize

TypeDefault
Vector3

The actual physical size of the BasePart as regarded by the physics engine, for example in collision detection.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly, NotReplicated]

FrontSurface

TypeDefault
SurfaceType

The FrontSurface property determines the type of surface used for the -Z direction of a part. When two parts' faces are placed next to each other, they may create a joint between them. If set to Motor, the BasePart.FrontSurfaceInput determines how a motor joint should behave.

Most SurfaceTypes render a texture on the part face if the BasePart.Material is set to Plastic. Some SurfaceTypes including Hinge, Motor, and SteppingMotor render a 3D adornment instead. If this property is selected in the Properties window, it will be highlighted in the game world similar to that of a SurfaceSelection.

History 4

GetClosestPointOnSurface

Parameters (1)
positionVector3
Returns (1)
Vector3

History 1

GetConnectedParts

Parameters (1)Default
recursiveboolfalse
Returns (1)
Instances

Returns a table of parts connected to the object by any kind of rigid joint.

If recursive is true this function will return all of the parts in the assembly rigidly connected to the BasePart.

Rigid Joints

When a joint connects two parts together (Part0 → Part1), a joint is rigid if the physics of Part1 are completely locked down by Part0. This only applies to the following joint types:

History 5

GetJoints

Parameters (0)
No parameters.
Returns (1)
Instances

Return all Joints or Constraints that is connected to this Part.

History 6

GetMass

Parameters (0)
No parameters.
Returns (1)
float

GetMass returns the value of the read-only Mass property.

This function predates the Mass property. It remains supported for backward-compatibility; you should use the Mass property directly.

History 5

GetNetworkOwner

Parameters (0)
No parameters.
Returns (1)
Instance

Returns the current player who is the network owner of this part, or nil in case of the server.

History 3

GetNetworkOwnershipAuto

Parameters (0)
No parameters.
Returns (1)
bool

Returns true if the game engine automatically decides the network owner for this part.

History 3

GetNoCollisionConstraints

Parameters (0)
No parameters.
Returns (1)
Instances

History 2

GetRenderCFrame

Parameters (0)
No parameters.
Returns (1)
CFrame

This function used to be relevant when Roblox's lag-compensating interpolation of parts online was internal. The interpolation is now applied to the CFrame directly.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 5

Tags: [Deprecated]

GetRootPart

Parameters (0)
No parameters.
Returns (1)
Instance

Returns the base part of an assembly. When moving an assembly of parts using a CFrame. it is important to move this base part (this will move all other parts connected to it accordingly). More information is available in the Assemblies article.

This function predates the AssemblyRootPart property. It remains supported for backwards compatibility, but you should use AssemblyRootPart directly.

History 3

GetTouchingParts

Parameters (0)
No parameters.
Returns (1)
Instances

Returns a table of all parts that are physically interacting with this part. If the part itself has CanCollide set to false, then this function returns an empty table unless the part has a TouchInterest object parented to it (meaning something is connected to its Touched event). Parts that are adjacent but not intersecting are not considered touching. This function predates the WorldRoot:GetPartsInPart() function, which provides more flexibility and avoids the special TouchInterest rules described above. Use WorldRoot:GetPartsInPart() instead.

History 3

GetVelocityAtPosition

Parameters (1)
positionVector3
Returns (1)
Vector3

Returns the linear velocity of the part's assembly at the given position relative to this part. It can be used to identify the linear velocity of parts in an assembly other than the root part. If the assembly has no angular velocity, than the linear velocity will always be the same for every position.

History 2

IntersectAsync

Parameters (3)Default
partsInstances
collisionfidelityCollisionFidelityDefault
renderFidelityRenderFidelityAutomatic
Returns (1)
Instance

Creates a new IntersectOperation from the intersecting geometry of the part and the other parts in the given array. Only Parts are supported, not Terrain or MeshParts. Similar to Clone(), the returned object has no set Parent.

The following properties from the calling part are applied to the resulting IntersectOperation:

In the following image comparison, IntersectAsync() is called on the purple block using a table containing the blue block. The resulting IntersectOperation resolves into a shape of the intersecting geometry of both parts.

Two block parts overlapping
Separate parts
Parts intersected into a new solid model
Resulting IntersectOperation

Notes

  • The original parts remain intact following a successful intersect operation. In most cases, you should Destroy() all of the original parts and parent the returned IntersectOperation to the same place as the calling BasePart.
  • By default, the face colors of the resulting intersection are borrowed from the Color property of the original parts. To change the entire intersection to a specific color, set its UsePartColor property to true.
  • If an intersect operation would result in a part with more than 20,000 triangles, it will be simplified to 20,000 triangles.
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

IsGrounded

Parameters (0)
No parameters.
Returns (1)
bool

Returns true if the object is connected to a part that will hold it in place (eg an Anchored part), otherwise returns false. In an assembly that has an Anchored part, every other part is grounded.

History 4

LeftSurface

TypeDefault
SurfaceType

The LeftSurface property determines the type of surface used for the -X direction of a part. When two parts' faces are placed next to each other, they may create a joint between them. If set to Motor, the BasePart.LeftSurfaceInput determines how a motor joint should behave.

Most SurfaceTypes render a texture on the part face if the BasePart.Material is set to Plastic. Some SurfaceTypes including Hinge, Motor, and SteppingMotor render a 3D adornment instead. If this property is selected in the Properties window, it will be highlighted in the game world similar to that of a SurfaceSelection.

History 4

LocalSimulationTouched

Parameters (1)
partBasePart

Fired when another part comes in contact with another object. This event only sends data to the client notifying it that two parts have collided, whereas BasePart.Touched sends data to the server.

This event is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 3

Tags: [Deprecated]

Locked

TypeDefault
bool

The Locked property determines whether a part (or a model it is contained within) may be selected in Roblox Studio by clicking on it. This property is most often enabled on parts within environment models that aren't being edited at the moment. Roblox Studio has a Lock/Unlock All tool that can toggle the Locked state of every part descendant in a model at once.

History 5

MakeJoints

Parameters (0)
No parameters.
Returns (1)
null

Creates a joint on any side of the Part that has a SurfaceType that can make a joint it will create a joint with any adjacent parts.

Joints will be created between the sides and any planar touching surfaces, depending on the sides' surfaces.

  • Smooth surfaces will not create joints
  • Glue surfaces will create a Glue joint
  • Weld will create a Weld joint with any surface except for Unjoinable
  • Studs, Inlet, or Universal will each create a Snap joint with either of other the other two surfaces (e.g. Studs with Inlet and Universal)
  • Hinge and Motor surfaces create Rotate and RotateV joint instances

Unlike Model:MakeJoints(), this function requires an array of parts as a parameter. This array is given as follows:

part:MakeJoints({part1, part2, part3})

Joints are broken if enough force is applied to them due to an Explosion, unless a ForceField object is parented to the BasePart or ancestor Model. For this reason, they are often used to make simple destructible buildings and other models.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 4

Tags: [Deprecated]

Mass

TypeDefault
float

Mass is a read-only property that describes the product of a part's volume and density. It is returned by the GetMass function.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 5

  • 553 Change Default of Mass from to
  • 520 Change Category of Mass from Data to Part
  • 486 Change ThreadSafety of Mass from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of Mass from to ReadOnly
  • 424 Add Mass
Tags: [ReadOnly, NotReplicated]

Massless

TypeDefault
bool

If this property is enabled, the BasePart will not contribute to the total mass or inertia of its assembly as long as it is welded to another part that has mass.

If the part is its own root part according to AssemblyRootPart, this will be ignored for that part, and it will still contribute mass and inertia to its assembly like a normal part. Parts that are massless should never become an assembly root part unless all other parts in the assembly are also massless.

This might be useful for things like optional accessories on vehicles that you don't want to affect the handling of the car or a massless render mesh welded to a simpler collision mesh.

See also Assemblies, an article documenting what root parts are and how to use them.

History 5

Material

TypeDefault
Material

The Material property allows a builder to set a part's texture and default physical properties (in the case that BasePart.CustomPhysicalProperties is unset). The default Plastic material has a very light texture, and the SmoothPlastic material has no texture at all. Some material textures like DiamondPlate and Granite have very visible textures. Each material's texture reflects sunlight differently, especially Foil.

Setting this property then enabling BasePart.CustomPhysicalProperties will use the default physical properties of a material. For instance, DiamondPlate is a very dense material while Wood is very light. A part's density determines whether it will float in terrain water.

The Glass material changes rendering behavior on moderate graphics settings. It applies a bit of reflectiveness (similar to BasePart.Reflectance) and perspective distortion. The effect is especially pronounced on sphere-shaped parts (set BasePart.Shape to Ball). Semitransparent objects and Glass parts behind Glass are not visible.

History 4

MaterialVariant

TypeDefault
string

The system searches the MaterialVariant instance with specified MaterialVariant name and BasePart.Material type. If it successfully finds a matching MaterialVariant instance, it uses this MaterialVariant instance to replace the default material. Default material can be the built-in material or an override MaterialVariant specified in MaterialService.

This property is not replicated. Its interface does not cross the network boundary.

History 4

Tags: [NotReplicated]

OutfitChanged

Parameters (0)
No parameters.

Fired if the part's appearance is affected by the Shirt class.

This event is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

PivotOffset

TypeDefault
CFrame

This property specifies the offset of the part's pivot from its CFrame, that is part:GetPivot() is the same as part.CFrame * part.PivotOffset.

This is convenient for setting the pivot to a location in local space, but setting a part's pivot to a location in world space can be done as follows:

local part = workspace.BluePart
local desiredPivotCFrameInWorldSpace = CFrame.new(0, 10, 0)
part.PivotOffset = part.CFrame:ToObjectSpace(desiredPivotCFrameInWorldSpace)

History 4

Reflectance

TypeDefault
float

The Reflectance property determines how much a part reflects the skybox. A value of 0 indicates the part is not reflective at all, and a value of 1 indicates the part should fully reflect.

Reflectance is not affected by BasePart.Transparency, unless the part is fully transparent, in which case reflectance will not render at all. Reflectance may or may not be ignored depending on the BasePart.Material of the part.

History 4

Resize

Parameters (2)
normalIdNormalId
deltaAmountint
Returns (1)
bool

Changes the size of an object just like using the Studio resize tool.

History 3

ResizeIncrement

TypeDefault
int

The ResizeIncrement property is a read-only property that describes the smallest change in size allowable by the BasePart:Resize() method. It differs between implementations of the BasePart abstract class. For instance, Part has this set to 1 and TrussPart has this set to 2 (since individual truss sections are 2x2x2 in size).

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 5

Tags: [ReadOnly, NotReplicated]

ResizeableFaces

TypeDefault
Faces

The ResizeableFaces property (with an e, not ResizableFaces) describes using a Faces object the different faces on which a part may be resized. For most implementations of BasePart, such as Part and WedgePart, this property includes all faces. However, TrussPart will set its ResizeableFaces set to only two faces since those kinds of parts must have two BasePart.Size dimensions of length 2. This property is most commonly used with tools used for building and manipulating parts and has little use outside of that context. The Handles class, which has the Handles.Faces property, can be used in conjunction with this property to display only the handles on faces that can be resized on a part.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 5

Tags: [ReadOnly, NotReplicated]

RightSurface

TypeDefault
SurfaceType

The RightSurface property determines the type of surface used for the +X direction of a part. When two parts' faces are placed next to each other, they may create a joint between them. If set to Motor, the BasePart.RightSurfaceInput determines how a motor joint should behave.

Most SurfaceTypes render a texture on the part face if the BasePart.Material is set to Plastic. Some SurfaceTypes including Hinge, Motor, and SteppingMotor will render a 3D adornment instead. If this property is selected in the Properties window, it will be highlighted in the game world similar to that of a SurfaceSelection.

History 4

RootPriority

TypeDefault
int

This property is an integer between -127 and 127 that takes precedence over all other rules for root part sort. When considering multiple parts that are not Anchored and which share the same Massless value, a part with a higher RootPriority will take priority over those with lower RootPriority.

You can use this property to control which part of an assembly is the root part and keep the root part stable if size changes.

See also Assemblies, an article documenting what root parts are and how to use them.

History 5

Rotation

TypeDefault
Vector3

The rotation of the part in degrees for the three axes.

When setting this property any Welds or Motor6Ds connected to this part will have the matching C0 or C1 property updated and to allow the part to move relative to any other parts it is joined to.

WeldConstraints will also be temporarily disabled and re-enabled during the move.

This property is not replicated. Its interface does not cross the network boundary.

History 4

Tags: [NotReplicated]

SetNetworkOwner

Parameters (1)Default
playerInstancePlayerPlayer
Returns (1)
null

Sets the given player as network owner for this and all connected parts. When playerInstance is nil, the server will be the owner instead of a player.

History 4

SetNetworkOwnershipAuto

Parameters (0)
No parameters.
Returns (1)
null

Lets the game engine dynamically decide who will handle the part's physics (one of the clients or the server).

History 3

Size

TypeDefault
Vector3

A part's Size property determines its visual dimensions, while ExtentsSize represents the actual size used by the physics engine, such as in collision detection. The individual dimensions (length, width, height) can be as low as 0.001 and as high as 2048. Size dimensions below 0.05 will be visually represented as if the part's dimensions are 0.05.

The size of the part determines its mass which is given by BasePart:GetMass(). A part's Size is used by a variety of other objects:

This property is not replicated. Its interface does not cross the network boundary.

History 6

  • 553 Change Default of Size from to
  • 538 Change Category of Size from Part to Transform
  • 486 Change ThreadSafety of Size from ReadOnly to ReadSafe
  • 476 Change Category of Size from Part to Part
  • 462 Change ThreadSafety of Size from to ReadOnly
  • 47 Add Size
Tags: [NotReplicated]

SpecificGravity

TypeDefault
float

The ratio of the part's density to the density of water determined by the BasePart.Material. Effects the part's behavior when in a water terrain cell. Essentially, SpecificGravity refers to how many times more dense a part is than water.

MaterialSpecificGravity
Plastic0.7
Wood0.35
Slate2.7
Concrete2.4
CorrodedMetal7.85
DiamondMetal7.85
Foil7.6
Grass0.9
Ice0.91
Marble2.56
Granite2.7
Brick1.92
Pebble2.4
Sand1.6
Fabric0.7
SmoothPlastic0.7
Metal7.85
WoodPlanks0.35
Cobblestone2.7
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 8

Tags: [ReadOnly, NotReplicated, Deprecated]

StoppedTouching

Parameters (1)
otherPartBasePart
This event is deprecated. It exists only for backward compatibility, and should not be used for new work. TouchEnded should be used instead.

History 8

Tags: [Deprecated]

SubtractAsync

Parameters (3)Default
partsInstances
collisionfidelityCollisionFidelityDefault
renderFidelityRenderFidelityAutomatic
Returns (1)
Instance

Creates a new UnionOperation from the part, minus the geometry occupied by the parts in the given array. Only Parts are supported, not Terrain or MeshParts. Similar to Clone(), the returned object has no set Parent.

Note that the resulting union cannot be empty due to subtractions. If the operation would result in completely empty geometry, it will fail.

In the following image comparison, SubtractAsync() is called on the blue cylinder using a table containing the purple block. The resulting UnionOperation resolves into a shape that omits the block's geometry from that of the cylinder.

Longer block overlapping a cylinder
Separate parts
Block part subtracted from cylinder
Resulting UnionOperation
This function yields. It will block the calling thread until completion.

History 4

Tags: [Yields]

TopSurface

TypeDefault
SurfaceType

The TopSurface property determines the type of surface used for the +Y direction of a part. When two parts' faces are placed next to each other, they may create a joint between them. If set to Motor, the BasePart.TopSurfaceInput determines how a motor joint should behave.

Most SurfaceTypes render a texture on the part face if the BasePart.Material is set to Plastic. Some SurfaceTypes - Hinge, Motor and SteppingMotor - will render a 3D adornment instead. If this property is selected in the Properties window, it will be highlighted in the game world similar to that of a SurfaceSelection.

History 4

TorqueToAngularAcceleration

Parameters (2)Default
torqueVector3
angVelocityVector30, 0, 0
Returns (1)
Vector3

History 1

TouchEnded

Parameters (1)
otherPartBasePart

Fires when a part stops touching another part under similar conditions to those of BasePart.Touched.

This event works in conjunction with Workspace.TouchesUseCollisionGroups to specify whether collision groups are acknowledged for detection.

History 3

Touched

Parameters (1)
otherPartBasePart

The Touched event fires when a part comes in contact with another part. For instance, if PartA bumps into PartB, then PartA.Touched fires with PartB, and PartB.Touched fires with PartA.

This event only fires as a result of physical movement, so it will not fire if the CFrame property was changed such that the part overlaps another part. This also means that at least one of the parts involved must not be Anchored at the time of the collision.

This event works in conjunction with Workspace.TouchesUseCollisionGroups to specify whether collision groups are acknowledged for detection.

History 3

Transparency

TypeDefault
float

The Transparency property controls the visibility of a part on a scale of 0 to 1, where 0 is completely visible (opaque), and a value of 1 is completely invisible (not rendered at all).

BasePart.Reflectance can reduce the overall transparency of a brick if set to a value close to 1.

While fully transparent parts are not rendered at all, partially transparent objects have some significant rendering costs. Having many translucent parts may slow down the game's performance.

When transparent parts overlap, render order can act unpredictable - try to keep semi-transparent parts from overlapping to avoid this.

The BasePart.LocalTransparencyModifier is a multiplier to Transparency that is only visible to the local client.

History 4

UnionAsync

Parameters (3)Default
partsInstances
collisionfidelityCollisionFidelityDefault
renderFidelityRenderFidelityAutomatic
Returns (1)
Instance

Creates a new UnionOperation from the part, plus the geometry occupied by the parts in the given array. Only Parts are supported, not Terrain or MeshParts. Similar to Clone(), the returned object has no set Parent.

The following properties from the calling part are applied to the resulting UnionOperation:

In the following image comparison, UnionAsync() is called on the blue block using a table containing the purple cylinder. The resulting UnionOperation resolves into a shape of the combined geometry of both parts.

Block and cylinder parts overlapping
Separate parts
Parts joined together into a single solid union
Resulting UnionOperation

Notes

  • The original parts remain intact following a successful union operation. In most cases, you should Destroy() all of the original parts and parent the returned UnionOperation to the same place as the calling BasePart.
  • By default, the resulting union respects the Color property of each of its parts. To change the entire union to a specific color, set its UsePartColor property to true.
  • If a union operation would result in a part with more than 20,000 triangles, it will be simplified to 20,000 triangles.
This function yields. It will block the calling thread until completion.

History 4

Tags: [Yields]

breakJoints

Parameters (0)
No parameters.
Returns (1)
null
This function is deprecated. It exists only for backward compatibility, and should not be used for new work. BreakJoints should be used instead.

History 4

Tags: [Deprecated]

brickColor

TypeDefault
BrickColor
This property is deprecated. It exists only for backward compatibility, and should not be used for new work. BrickColor should be used instead.
This property is not replicated. Its interface does not cross the network boundary.

History 5

Tags: [NotReplicated, Deprecated]

getMass

Parameters (0)
No parameters.
Returns (1)
float
This function is deprecated. It exists only for backward compatibility, and should not be used for new work. GetMass should be used instead.

History 5

  • 641 Change PreferredDescriptor of getMass from to GetMass
  • 462 Change ThreadSafety of getMass from to Unsafe
  • 424 Change Tags of getMass from [Deprecated, CustomLuaState] to [Deprecated]
  • 349 Change Tags of getMass from [Deprecated] to [Deprecated, CustomLuaState]
  • 48 Add getMass
Tags: [Deprecated]

makeJoints

Parameters (0)
No parameters.
Returns (1)
null
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 3

Tags: [Deprecated]

resize

Parameters (2)
normalIdNormalId
deltaAmountint
Returns (1)
bool
This function is deprecated. It exists only for backward compatibility, and should not be used for new work. Resize should be used instead.

History 3

Tags: [Deprecated]

Removed members 14

BodyAngularVelocity

TypeDefault
Vector3
This property is not replicated. Its interface does not cross the network boundary.

History 2

Tags: [NotReplicated]

BodyCenterOfMass

TypeDefault
Vector3
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly, NotReplicated]

BodyLinearVelocity

TypeDefault
Vector3
This property is not replicated. Its interface does not cross the network boundary.

History 2

Tags: [NotReplicated]

BodyMass

TypeDefault
float
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly, NotReplicated]

LinearVelocity

TypeDefault
Vector3
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly, NotReplicated]

Negate

Parameters (0)
No parameters.
Returns (1)
Instance

History 2

Separate

Parameters (0)
No parameters.
Returns (1)
Objects

History 2

UnionWith

Parameters (1)
partInstance
Returns (1)
Instance

History 2

subtractAsync2_INTERNAL

Parameters (3)Default
partsObjects
collisionfidelityCollisionFidelityDefault
renderFidelityRenderFidelityAutomatic
Returns (1)
Objects
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

touched

Parameters (1)
otherPartInstance
This event is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 3

Tags: [Deprecated]

unionAsync2_INTERNAL

Parameters (3)Default
partsObjects
collisionfidelityCollisionFidelityDefault
renderFidelityRenderFidelityAutomatic
Returns (1)
Objects
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

Settings