Part
Inherits from DynamicInstance
Parts are physical objects that can be placed in the world.
Summary
Properties
Anchored:boolAngularDrag:floatAngularVelocity:Vector3Bounciness:floatCanCollide:boolCastShadows:boolColor:ColorDrag:floatFriction:floatForward:Vector3HideStuds:boolIsSpawn:boolMass:floatMaterial:PartMaterialShape:PartShapeUseGravity:boolVelocity:Vector3
Methods
MovePosition:voidMoveRotation:voidAddForce:voidAddTorque:voidAddForceAtPosition:voidAddRelativeForce:voidAddRelativeTorque:void
Properties
Anchored
Part.Anchored: bool
Specifies whether the part is to be affected by physics or not.
AngularDrag
Part.AngularDrag: float
Angular drag (air resistance) of this part.
AngularVelocity
Part.AngularVelocity: Vector3
Specifies the angular velocity of a part.
Bounciness
Part.Bounciness: float
Determines how bouncy the part is when players land on it.
CanCollide
Part.CanCollide: bool
Specifies whether the part can be collided with or not.
CastShadows
Part.CastShadows: bool
Specifies whether the part casts its shadow on other parts.
Color
Part.Color: Color
Specifies the color of a part.
Drag
Part.Drag: float
Determines Drag (air resistance) of this part.
Friction
Part.Friction: float
Determines the amount of friction between the part and players on it.
Forward
Part.Forward: Vector3
Returns the forward vector of the part
HideStuds
Part.HideStuds: bool
Determines whether to display studs on the part or not.
IsSpawn
Part.IsSpawn: bool
Specifies whether the part can be used as a spawn location or not.
Mass
Part.Mass: float
Specifies the mass of a part in kilograms.
Material
Part.Material: PartMaterial
Specifies the material of the part.
Example
part.Material = PartMaterial.Concrete
Shape
Part.Shape: PartShape
Specifies the shape of a part.
Example
part.Shape = PartShape.Wedge
UseGravity
Part.UseGravity: bool
Determines whether this part is affected by gravity or not.
Velocity
Part.Velocity: Vector3
Specifies the velocity of a part.
Methods
MovePosition
Part:MovePosition(position: Vector3)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
position | Vector3 | - |
Moves the part to the specified position while keeping physics in mind.
Example
game["Environment"]["Part"]:MovePosition(Vector3.New(50, 0, 0))
MoveRotation
Part:MoveRotation(rotation: Vector3)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
rotation | Vector3 | - |
Rotates the part while keeping physics in mind.
Example
game["Environment"]["Part"]:MoveRotation(Vector3.New(0, 180, 0))
AddForce
Part:AddForce(force: Vector3, mode: ForceMode)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
force | Vector3 | - | |
mode | ForceMode | - |
Adds a force to the part.
AddTorque
Part:AddTorque(torque: Vector3, mode: ForceMode)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
torque | Vector3 | - | |
mode | ForceMode | - |
Adds a torque to the part.
AddForceAtPosition
Part:AddForceAtPosition(force: Vector3, position: Vector3, mode: ForceMode)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
force | Vector3 | - | |
position | Vector3 | - | |
mode | ForceMode | - |
Adds a force to the part at a specific position.
AddRelativeForce
Part:AddRelativeForce(force: Vector3, mode: ForceMode)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
force | Vector3 | - | |
mode | ForceMode | - |
Adds a force to the part relative to its own rotation.
AddRelativeTorque
Part:AddRelativeTorque(torque: Vector3, mode: ForceMode)
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
torque | Vector3 | - | |
mode | ForceMode | - |
Adds a torque to the part relative to its own rotation.