BasePart|BaseParts are a deceptively simple instance. They are literally the “building blocks of Roblox” and have a myriad of customizable properties that can seem overwhelming. This article outlines parts as physical bodies and how they work together.
At the simplest level, a
BasePart is a piece of 3D geometry that has a position and orientation defined by its
datatype/CFrame, as well as a size.
An assembly is one or more
BasePart|BaseParts connected by rigid
Motor6D|Motor6Ds (animated rigid joints).
WorldModelinstance. If the parts are stored elsewhere, all of the welds/connections that combine parts into assemblies will be non-functional.
An assembly is considered a single rigid body in the physics engine, meaning no force can push or pull the connected parts from each other and they will move as a single unit. All forces applied to a specific
BasePart are applied to its assembly — for instance, when
BasePart/ApplyImpulse is called, it takes
BasePart/AssemblyMass into account and applies the impulse to the assembly at the
BasePart properties show data regarding its assembly. Their values will be the same for any part in the same assembly, so it doesn’t matter which part you use.
||The linear velocity vector of the part's assembly. Setting the velocity directly may lead to unrealistic motion, so usage of a
||The angular velocity vector of the part's assembly. Setting the velocity directly may lead to unrealistic motion, so usage of a
||A read-only position calculated via the mass and position of all the parts in the assembly. A force applied to the center of mass will not cause angular acceleration, only linear.|
||The sum of the
||The part automatically chosen to represent the assembly's root part. See Assembly Root Part below for more details.|
Assembly Root Part
Every assembly has a root part indicated by its
BasePart/AssemblyRootPart|AssemblyRootPart property. You cannot explicitly set the root part, but the following factors affect probability:
||Precedence based on the part's size, with multipliers for parts with specific names.|
Motor6Dtransforms are updated. It's also used to keep consistent physics replication and
articles/Network Ownership|network ownership.
Root Part Anchoring
When one of the parts in an assembly is anchored, that part becomes the root part and all of the other parts become implicitly anchored with it.
- Below, four parts are welded together with
WeldConstraint|WeldConstraints(green bars) to form a single assembly, as indicated by the matching colored outlines.
- If just one assembly part is anchored, the assembly will not change, other than the root part potentially changing (the anchored part has the highest priority for becoming the root part).
- If more than one part is anchored, the assembly will split. Here, both the left and top parts are anchored, so the original assembly splits into two assemblies as shown by the colored outlines. Also, the
WeldConstraintbetween the two assemblies deactivates, since you can’t have an active weld between two anchored assemblies.