MeshPart
Inherits from Part
MeshPart is a part that can have custom mesh applied to it, the mesh may be from the Polytoria Store (Hats, Tools and Heads) or user-uploaded meshes.
Summary
Properties
Anchored:boolAngularVelocity:Vector3 = Vector3.NewAssetID:intCanCollide:boolMass:floatMaterial:PartMaterialShape:PartShapeVelocity:Vector3 = Vector3.NewCurrentAnimation:stringIsAnimationPlaying:boolPlayAnimationOnStart:boolCollisionType:CollisionType
Methods
MovePosition:voidMoveRotation:voidPlayAnimation:voidStopAnimation:voidGetAnimations:voidGetAnimationSources:string[]:voidGetAnimationInfo:AnimationInfo[]:void
Properties
Anchored
MeshPart.Anchored: bool
Specifies whether the part is to be affected by physics or not.
AngularVelocity
MeshPart.AngularVelocity: Vector3 = Vector3.New
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
0 | any | - | |
0 | any | - | |
0 | any | - |
Specifies the angular velocity of a part.
AssetID
MeshPart.AssetID: int
The asset ID of the mesh part.
CanCollide
MeshPart.CanCollide: bool
Specifies whether the part can be collided with or not.
Mass
MeshPart.Mass: float
Specifies the mass of a part in kilograms.
Material
MeshPart.Material: PartMaterial
Specifies the material of the part.
Shape
MeshPart.Shape: PartShape
Specifies the shape of a part.
Velocity
MeshPart.Velocity: Vector3 = Vector3.New
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
0 | any | - | |
100 | any | - | |
0 | any | - |
Specifies the velocity of a part.
CurrentAnimation
MeshPart.CurrentAnimation: string
The current animation of the mesh part.
IsAnimationPlaying
MeshPart.IsAnimationPlaying: bool
Returns whether or not the animation is playing.
PlayAnimationOnStart
MeshPart.PlayAnimationOnStart: bool
Specifies whether or not to play the animation on start.
CollisionType
MeshPart.CollisionType: CollisionType
Specifies the collision type of the part.
Methods
MovePosition
MeshPart:MovePosition(position: Vector3)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
position | Vector3 | - |
Moves the MeshPart to the specified position.
MoveRotation
MeshPart:MoveRotation(rotation: Vector3)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
rotation | Vector3 | - |
Rotates the MeshPart to the specified rotation.
PlayAnimation
MeshPart:PlayAnimation(animationName: string, objectPath: string, speed: float, loop: bool)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
animationName | string | - | |
objectPath | string | nil | |
speed | float | 1 | |
loop | bool | false |
Plays the animation with the specified name, if it exists.
StopAnimation
MeshPart:StopAnimation(name: string)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | nil |
Stops playing the current animation.
GetAnimations
MeshPart:GetAnimations()
Returns the names of the animations associated with the mesh.
GetAnimationSources:string
MeshPart:GetAnimationSources:string[]()
GetAnimationInfo:AnimationInfo
MeshPart:GetAnimationInfo:AnimationInfo[]()