Roblox Wiki
Roblox Wiki
Line 181: Line 181:
 
=== {{method|Objects|name=GetConnectedParts|2 = bool recursive = false}} ===
 
=== {{method|Objects|name=GetConnectedParts|2 = bool recursive = false}} ===
   
=== {{method|Objects|name=GetJoints|RobloxScriptSecurity}} ===
+
=== {{method|Objects|name=GetJoints|RobloxPlaceSecurity}} ===
   
 
=== {{method|float|name=GetMass}} ===
 
=== {{method|float|name=GetMass}} ===

Revision as of 12:30, 30 November 2017

The BasePart class is a structural class that holds all the properties, methods and events common to part classes, such as Part light iconPart dark iconPart, WedgePart light iconWedgePart dark iconWedgePart, CornerWedgePart light iconCornerWedgePart dark iconCornerWedgePart, TrussPart light iconTrussPart dark iconTrussPart, SpawnLocation light iconSpawnLocation dark iconSpawnLocation, Seat light iconSeat dark iconSeat, VehicleSeat light iconVehicleSeat dark iconVehicleSeat, SkateboardPlatform light iconSkateboardPlatform dark iconSkateboardPlatform, and FlagStand light iconFlagStand dark iconFlagStand. The most common is the simple part. While many of these classes extend the BasePart class directly, some extend the FormFactorPart class, which is itself a subclass of BasePart. The BasePart class cannot be instantiated.

Properties

Anchored: bool

Determines whether or not physics acts upon the Part. If true, part stays 'Anchored' in space, not moving regardless of any collision/forces acting upon it. If false, physics works normally on the part.

BrickColor: BrickColor

The color of a part is set by the value of its BrickColor property. Brick colors are a set of pre-defined colors that the user may choose from to color parts, teams and other things in the ROBLOX engine.

CFrame: CoordinateFrame

Contains information regarding the Part's position and a matrix that defines the Part's rotation. Can read/write.

CanCollide: bool

Determines whether physical interactions with other Parts are respected. If true, will collide and react with physics to other Parts. If false, other parts will pass thru instead of colliding.

CenterOfMass: Vector3

CollisionGroupId: int

The id of the collision group this basepart is in. This can be used with PhysicsService.

Color: Color3

The Color3 of the BasePart.

CustomPhysicalProperties: PhysicalProperties

A container that allows you to edit the properties of this basepart.

Elasticity: float

A float value ranging from 0.0f to 1.0f. Sets how much the Part will rebound against another. a value of 1 is like a superball, and 0 is like a lead block.

Friction: float

A float value ranging from 0.0f to 1.0f. Sets how much the Part will be able to slide. a value of 1 is no sliding, and 0 is no friction, so infinite sliding.

LocalTransparencyModifier: float

Locked: bool

Determines whether building tools (in-game and studio) can manipulate this Part. If true, no editing allowed. If false, editing is allowed.

Material: Material

Specifies the look and feel the Part should have. Note: this does not define the color the Part is, see BrickColor for that.

Orientation: Vector3

Rotation around X, Y, and Z axis. Rotations applied in YXZ order.

Position: Vector3

A part's position can be changed by modifying the value of this property.

ReceiveAge: float

Reflectance: float

Specifies how shiny the Part is. A value of 1 is completely reflective (chrome), while a value of 0 is no reflectance (concrete wall)

ResizeIncrement: int

Sets the value for the smallest change in size allowable by the Resize(NormalId, int) function.

ResizeableFaces: Faces

Sets the value for the faces allowed to be resized by the Resize(NormalId, int) function.

RotVelocity: Vector3

This property defines the rotational velocity of the part it belongs to.

Rotation: Vector3

The part's rotation.

Size: Vector3

This property defines the size of the part it belongs to.

SpecificGravity: float

This property defines how many times more dense than ROBLOX's water the part it belongs to is. Its value depends on the part's material.

Transparency: float

Sets how visible an object is. A value of 1 makes the object invisible, while a value of 0 makes the object opaque.

Velocity: Vector3

How fast the Part is traveling in studs/second. This property is NOT recommended to be modified directly, unless there is good reason. Otherwise, try using a BodyForce to move a Part.

brickColor: BrickColor

This property is deprecated and the BrickColor property should be used instead.

Surface inputs

The surface input properties are used to specify an input for a specific surface.

BackSurfaceInput: InputType

BottomSurfaceInput: InputType

FrontSurfaceInput: InputType

LeftSurfaceInput: InputType

RightSurfaceInput: InputType

TopSurfaceInput: InputType

Surface types

The surface type properties can be used to change the appearance of a specific surface of a part. Surface types also change the behavior of parts with other parts they are sticking to.

BackSurface: SurfaceType

BottomSurface: SurfaceType

FrontSurface: SurfaceType

LeftSurface: SurfaceType

RightSurface: SurfaceType

TopSurface: SurfaceType

Surface parameters

The surface parameter properties are used to give parameters to certain surfaces of a part. These parameters are used, for example, by the motor part surface.

BackParamA: float

BackParamB: float

BottomParamA: float

BottomParamB: float

FrontParamA: float

FrontParamB: float

LeftParamA: float

LeftParamB: float

RightParamA: float

RightParamB: float

TopParamA: float

TopParamB: float

Methods

BreakJoints(): void

Destroys SurfaceJoints with all parts that are touching this Instance (including internal joints in the Instance, as in a Model).

CanCollideWith(part: Instance): bool

CanSetNetworkOwnership(): Tuple

GetConnectedParts(recursive: bool = false): Objects

GetJoints(): Objects

GetMass(): float

Returns a number that is the mass of this Instance. Mass of a Part is immutable, and is changed only by the size of the Part.

GetNetworkOwner(): Instance

GetNetworkOwnershipAuto(): bool

GetRenderCFrame(): CoordinateFrame

GetRootPart(): Instance

GetTouchingParts(): Objects

Returns an array of all the parts touching this part.

IsGrounded(): bool

Returns whether or not this BasePart is connected to an Anchored BasePart.

MakeJoints(): void

Creates the appropriate SurfaceJoints with all parts that are touching this Instance (including internal joints in the Instance, as in a Model). This uses the SurfaceTypes defined on the surfaces of parts to create the appropriate welds.

Resize(normalId: NormalId, deltaAmount: int): bool

Resizes a Part in the direction of the face defined by 'NormalId', by the amount specified by 'deltaAmount'. If the operation will expand the part to intersect another Instance, the part will not resize at all. Return true if the call is successful, false otherwise.

SetNetworkOwner(playerInstance: Instance = nil): void

SetNetworkOwnershipAuto(): void

breakJoints(): void

Deprecated. Use BreakJoints instead.

getMass(): float

Use GetMass instead.

makeJoints(): void

Use MakeJoints instead.

resize(normalId: NormalId, deltaAmount: int): bool

Events

LocalSimulationTouched(part: Instance)

Deprecated. Use Touched instead.

OutfitChanged()

This event will be fired when one of the visual properties of the part it belongs to is changed.

StoppedTouching(otherPart: Instance)

Deprecated. Use TouchEnded instead.

TouchEnded(otherPart: Instance)

Fired when the part stops touching another part

Touched(otherPart: Instance)

This event will be fired by the game engine when a part touches the part to which the event belongs.

touched(otherPart: Instance)

This event is deprecated. The Touched event should be used instead.