We use cookies on this site to enhance your user experience
Collapse Sidebar

MeshPart

Deprecated

MeshPart

Deprecated

MeshParts are a form of BasePart that includes a physically simulated custom mesh. Unlike with other mesh classes, such as SpecialMesh and BlockMesh, they are not parented to a BasePart but rather behave as a BasePart in their own right.

How do I use MeshParts

The mesh and texture of a MeshPart are determined by the MeshPart/MeshId and MeshPart/TextureID properties. For more information on how to use MeshParts please see Articles/Mesh Parts|here.

SpecialMesh or MeshPart?

There are currently two ways of using a developer created mesh. They are using a SpecialMesh with the SpecialMesh/FileType set to ‘FileMesh’, or by using a MeshPart. Although, on the whole, the MeshPart object has superseded the SpecialMesh there are some differences developers should be aware of.

  • BasePart/Material displays correctly on the mesh when using a MeshPart and not when using a SpecialMesh
  • MeshParts include the MeshPart/CollisionFidelity property, meaning the collision model of a MeshPart can be set to resemble the geometry of the mesh. The SpecialMesh object by contrast, uses the parent BaseParts collision model
  • The mesh of a MeshPart scales on all axis depending on the BasePart/Size property of the MeshPart, the mesh of a SpecialMesh does not
  • The SpecialMesh object includes the DataModelMesh/Offset and DataModelMesh/Scale properties whereas MeshParts do not
  • The DataModelMesh/MeshId property of a SpecialMesh can be changed by a Script or LocalScript during runtime. The MeshPart/MeshId property of a MeshPart can not

In most, but not all cases, using a MeshPart is more suitable. As MeshParts are a relatively new feature however, developers should expect some of the above behaviour to change.

Properties

CollisionFidelity

CollisionFidelity

[NotReplicated] [NotScriptable]

This property determines how the collision model of the MeshPart relates to the actual geometry of the mesh.

Content

MeshId

The MeshId is the content ID of the mesh that is to be displayed on the MeshPart.

Content

TextureID

The texture applied to the MeshPart.

Inherited from BasePart: Show Hide

float

LocalTransparencyModifier

[Hidden] [NotReplicated]
Determines a multiplier for `BasePart/Transparency` that is only visible to the local client
float

Transparency

Determines how much a part can be seen through (the inverse of part opacity)
PhysicalProperties

CustomPhysicalProperties

Determines several physical properties of a part
bool

Locked

Determines whether a part is selectable in Studio.
float

BackParamA

Determines the first parameter for the SurfaceType on the Back face of a part (-Z direction)
float

BackParamB

Determines the second parameter for the SurfaceType on the Back face of a part (-Z direction)
InputType

BackSurfaceInput

Determines the kind of input for the Back face of a part (+Z direction)
float

BottomParamA

Determines the first parameter for the SurfaceType on the Bottom face of a part (-Y direction)
float

BottomParamB

Determines the second parameter for the SurfaceType on the Bottom face of a part (-Y direction)
float

FrontParamA

Determines the first parameter for the SurfaceType on the Front face of a part (-Z direction)
float

FrontParamB

Determines the second parameter for the SurfaceType on the Front face of a part (-Z direction)
float

LeftParamA

Determines the first parameter for the SurfaceType on the Left face of a part (-Z direction)
float

LeftParamB

Determines the second parameter for the SurfaceType on the Left face of a part (-Z direction)
float

RightParamA

Determines the first parameter for the SurfaceType on the Right face of a part (-X direction)
float

RightParamB

Determines the second parameter for the SurfaceType on the Right face of a part (-X direction)
float

TopParamA

Determines the first parameter for the SurfaceType on the Top face of a part (+Y direction)
float

TopParamB

Determines the second parameter for the SurfaceType on the Top face of a part (+Y direction)
Vector3

Velocity

Determines a part's change in position over time
InputType

TopSurfaceInput

Determines the kind of input for the Top face of a part (+Y direction)
SurfaceType

TopSurface

Determines the type of surface for the Top face of a part (+Y direction)
Vector3

Size

[NotReplicated]
Determines the dimensions of a part (length, width, height)
Vector3

Rotation

[NotReplicated]
The rotation of the part in degrees for the three axes.
Vector3

RotVelocity

Determines a part's change in orientation over time
InputType

RightSurfaceInput

Determines the kind of input for the Right face of a part (-X direction)
SurfaceType

RightSurface

Determines the type of surface for the Right face of a part (+X direction)
Faces

ResizeableFaces

[ReadOnly] [NotReplicated]
Describes the faces on which a part may be resized
int

ResizeIncrement

[ReadOnly] [NotReplicated]
Describes the smallest change in size allowable by the Resize method
float

Reflectance

Determines how much a part reflects the skybox.
float

ReceiveAge

[Hidden] [ReadOnly] [NotReplicated]
Time since last recorded physics update
Vector3

Position

[NotReplicated]
Describes the position of the part in the world.
Vector3

Orientation

[NotReplicated]
Describes the position of the part in the world.
Material

Material

Determines the texture and default physical properties of a part
InputType

LeftSurfaceInput

Determines the kind of input for the Left face of a part (+X direction)
SurfaceType

LeftSurface

Determines the type of surface for the Left face of a part (-X direction)
InputType

FrontSurfaceInput

Determines the kind of input for the Front face of a part (-Z direction)
SurfaceType

FrontSurface

Determines the type of surface for the Front face of a part (-Z direction)
Color3

Color

[NotReplicated]
Determines the color of a part.
int

CollisionGroupId

Describes the automatically-set ID number of a part's collision group
Vector3

CenterOfMass

[ReadOnly] [NotReplicated]
Describes the world position in which a part's center of mass is located.
bool

CanCollide

Determines whether a part may collide with other parts.
CFrame

CFrame

Determines the position and rotation of a part in the world
BrickColor

BrickColor

[NotReplicated]
Determines the color of a part.
InputType

BottomSurfaceInput

Determines the kind of input for the Bottom face of a part (-Y direction)
SurfaceType

BottomSurface

Determines the type of surface for the Bottom face of a part (-Y direction)
SurfaceType

BackSurface

Determines the type of surface for the Back face of a part (+Z direction)
bool

Anchored

Determines whether a part is immovable by physics

Inherited from Instance: Show Hide

int

DataCost

[ReadOnly] [NotReplicated]
The cost of saving the instance using data persistence.
Instance

Parent

Determines the hierarchical parent of the `Instance`.
bool

RobloxLocked

If true, the `Instance` and its descendants cannot be indexed or edited by a `Script` or `LocalScript` and will throw an error if it is attempted.
string

ClassName

[ReadOnly] [NotReplicated]
A read-only string representing the class this `Instance` belongs to.
string

Name

A non-unique identifier of the `Instance`.
bool

Archivable

Determines if an `Instance` can be cloned using `/Instance/Clone` or saved to file.

Functions

Inherited from BasePart: Show Hide

float

GetMass ( )

[CustomLuaState]
Returns the part's mass based on the part's material and size
Instance

SubtractAsync ( Objects parts , CollisionFidelity collisionFidelity )

[Yields]
Subtracts other parts using CSG, returning a `UnionOperation`
Instance

UnionAsync ( Objects parts , CollisionFidelity collisionFidelity )

[Yields]
Combines other parts using CSG, returning a `UnionOperation`
Tuple

CanSetNetworkOwnership ( )

Checks whether you can set a `BasePart|part's` network ownership
Objects

GetTouchingParts ( )

Returns a table of all CanCollide true parts that intersect with this part.
void

SetNetworkOwner ( Instance playerInstance )

Sets the given player as network owner for this and all connected parts
Instance

GetRootPart ( )

Returns the base part of an assembly of parts.
void

SetNetworkOwnershipAuto ( )

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

Resize ( NormalId normalId , int deltaAmount )

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

MakeJoints ( )

Creates a joint on any side of the object that has a surface ID that can make a joint.
bool

IsGrounded ( )

Returns true if the object is connected to a part that will hold it in place (eg an `BasePart/Anchored` part), otherwise returns false.
bool

GetNetworkOwnershipAuto ( )

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

GetNetworkOwner ( )

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

GetJoints ( )

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

GetConnectedParts ( bool recursive )

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

CanCollideWith ( Instance part )

Returns whether the parts can collide with each other.
void

BreakJoints ( )

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

Inherited from Instance: Show Hide

Array

GetDescendants ( )

[CustomLuaState]
Returns an array containing all of the `Instance`'s descendants.
bool

IsAncestorOf ( Instance descendant )

Returns true if an `Instance` is an ancestor of the given descendant.
bool

IsDescendantOf ( Instance ancestor )

Returns true if an `Instance` is a descendant of the given ancestor.
Instance

FindFirstChildWhichIsA ( string className , bool recursive )

Returns the first child of the `Instance` for whom `Instance/IsA` returns true for the given className.
Instance

FindFirstChildOfClass ( string className )

Returns the first child of the `Instance` whose `Instance/ClassName|ClassName` is equal to the given className.
Instance

FindFirstChild ( string name , bool recursive )

Returns the first child of the `Instance` found with the given name.
Instance

FindFirstAncestorWhichIsA ( string className )

Returns the first ancestor of the `Instance` for whom `Instance/IsA` returns true for the given className.
Instance

FindFirstAncestorOfClass ( string className )

Returns the first ancestor of the `Instance` whose `Instance/ClassName` is equal to the given className.
Instance

FindFirstAncestor ( string name )

Returns the first ancestor of the `Instance` whose `Instance/Name` is equal to the given name.
bool

IsA ( string className )

Returns true if an `Instance`'s class matches or inherits from a given class
Instance

WaitForChild ( string childName , double timeOut )

[CustomLuaState] [CanYield]
Returns the child of the `Instance` with the given name. If the child does not exist, it will yield the current thread until it does.
RBXScriptSignal

GetPropertyChangedSignal ( string property )

Get an event that fires when a given property of an object changes.
string

GetFullName ( )

Returns a string showing the `Instance`'s ancestry.
string

GetDebugId ( int scopeLength )

[NotBrowsable]
Returns a coded string of the `Instance`s DebugId used internally by Roblox.
Objects

GetChildren ( )

Returns an array containing all of the `Instance`'s children.
void

Destroy ( )

Sets the `Instance/Parent` property to nil, locks the `Instance/Parent` property, disconnects all connections and calls Destroy on all children.
Instance

Clone ( )

Create a deep copy of a Roblox instance and descendants where `Archivable = true`.
void

ClearAllChildren ( )

This function destroys all of an `Instance`'s children.

Events

Inherited from BasePart: Show Hide

RBXScriptSignal

Touched ( Instance otherPart )

Fired when a part comes in contact with another part
RBXScriptSignal

TouchEnded ( Instance otherPart )

Fired when a part stops touching another part.

Inherited from Instance: Show Hide

RBXScriptSignal

AncestryChanged ( Instance child , Instance parent )

Fires when the `Instance/Parent` property of the object or one of its ancestors is changed.
RBXScriptSignal

ChildAdded ( Instance child )

Fires when an object is parented to this `Instance`.
RBXScriptSignal

ChildRemoved ( Instance child )

Fires when a child is removed from this `Instance`.
RBXScriptSignal

DescendantAdded ( Instance descendant )

Fires when a descendant is added to the `Instance`.
RBXScriptSignal

DescendantRemoving ( Instance descendant )

Fires immediately before a descendant of the `Instance` is removed.
RBXScriptSignal

Changed ( string property )

Fired immediately after a property of an object changes.