Part
The base class for physical objects
Properties
| Name | Type | Description |
|---|---|---|
| CData | CData | The coordinate data of this object in the 3D gamespace. |
| Material | Number | When true, the part does not react to physics |
| Anchored | Boolean | |
| StaticObject | Boolean | |
| CastsShadows | Boolean | Does the part cast shadows or not? |
| Mass | Number | The mass of the part |
| Drag | Number | The drag of the part. A higher drag means the part slows down faster. |
| AngularDrag | Number | The angular drag of the part. A higher angular drag makes the part harder to rotate. |
| UseGravity | Boolean | Determines whether gravity affects the part. |
| Velocity | Vector3 | The velocity of the part. Zero if anchored |
| AngularVelocity | Vector3 | The angular velocity of the part. Zero if anchored |
| CanCollide | Boolean | When true, the part can overlap other physics objects |
| Shape | String | The 3D geometric shape of the part. Currently available: Cube, Sphere, Cylinder, Cone, Wedge |
| Color | PartColor | The color of the part |
| Opacity | Number | The opacity of the part represented as a byte. (0 = invisible, 255 = opaque) |
| Transparency | Number | The transparency of the part represented as a byte. (0 = opaque, 255 = invisible) |
| Spawn | Boolean | When true, players can spawn on top of this part. |
| Inherited from Dynamic | Name Enabled Root Tag Position Rotation LocalRotation Size Parent TextureID TextureTiling TextureTilingY |
Functions
| Name | Returns | Description |
|---|---|---|
| AddForce | Void | Adds a force to the part along each axis. Type is Force type (0 = Force, 1 = Impulse, 2 = VelocityChange, 3 = Acceleration) |
| AddForceAtPosition | Void | Adds a force to the part at a specific position on the part. Type is Force type (0 = Force, 1 = Impulse, 2 = VelocityChange, 3 = Acceleration) |
| AddTorque | Void | Adds a torque to the part |
| AddRelativeForce | Void | Adds a relative force to the part along each axis. Type is Force type (0 = Force, 1 = Impulse, 2 = VelocityChange, 3 = Acceleration) |
| AddRelativeTorque | Void | Adds a relative torque to the part |
| PhysicsMove | Void | Sets the position of the part and accounts for physics if unanchored |
| IsTouching | Boolean | Checks if this part is touching another part |
| PhysicsRotate | Void | Sets the rotation of the part and accounts for physics if unanchored |
| SetCollisions | Void | Enable/disable collisions between two parts. Set ignore to true to ignore collisions between this part and the part specified |
| Inherited from Dynamic | SetParent Log IsA FindFirstChild FindFirstChildOfClass FindFirstParentOfClass MoveTo NetworkSync LookAt LocalToWorldPoint Clone GetChildren ClearChildren Destroy |
Events
| Name | Description |
|---|---|
| Touched | Occurs when an object bumps into the part. |
| TouchEnded |