PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

MakeJoints

Deprecated

SurfaceType based joining is deprecated, do not use MakeJoints for new projects. WeldConstraint|WeldConstraints and HingeConstraint|HingeConstraints should be used instead

Goes through all BasePart|Parts in the Model and creates joints between the specified Parts and any planar touching surfaces, depending on the parts’ surfaces.

  • Smooth surfaces will not create joints
  • Glue surfaces will create a Glue joint
  • Weld will create a Weld joint with any surface except for Unjoinable
  • Studs, Inlet, or Universal will each create a Snap joint with either of other the other two surfaces (e.g. Studs with Inlet and Universal)
  • Hinge and Motor surfaces create Rotate and RotateV joint instances

This function will not work if the Part is not a descendant of Workspace. Therefore developers must first ensure the Model is parented to Workspace before using MakeJoints.

Returns

Return Type Summary

Code Samples


Model MakeJoints

This code sample demonstrates how joints can be made using the Model:MakeJoints function.

A model is instanced, with two parts on top of each other. The top part is anchored and the bottom part is not. Normally, when parented to the Workspace the bottom part would fall to the Baseplate.

However, as TopSurface property of the bottom part is set to Enum.SurfaceType.Weld, this means that when Model:MakeJoints is ran a connection is made between them.

Therefore the bottom part does not drop until the joints in the model are broken. This is often done using Model:BreakJoints, but in this example the connection is broken using an explosion.


Simple Joint Creation

This code sample demonstrates creation of joints on two parts that are siblings of the script (PartA and PartB). It uses MakeJoints on two touching parts with compatible surface types (Studs and Inlet).