BreakJoints (Function): Difference between revisions

From Goodblox Wiki
Jump to navigationJump to search
(created the page)
 
(created the page for real this time. accidentally wrote the page for the wrong function YOU IDIOT)
Line 4: Line 4:
|arguments            =  
|arguments            =  
|returns              = n/a
|returns              = n/a
|description          = Creates a joint on any side of the object that has a surface ID that can make a joint.
|description          = Breaks any surface connection with any adjacent part, including [[GBX.lua.Weld (Object)|Welds]] and other [[GBX.lua.JointInstance (Object)|JointInstances]].
|object              = [[GBX.lua.BasePart (Object)|BasePart]], [[GBX.lua.Model (Object)|Model]]
|object              = [[GBX.lua.BasePart (Object)|BasePart]], [[GBX.lua.Model (Object)|Model]]
}}</onlyinclude>
}}</onlyinclude>


==Description==
'''Example'''
MakeJoints forms a bond (a joint) between bricks if they have the required surface types:


{| class="wikitable"
This code will break all the joints contained in the [[GBX.lua.Model (Object)|Model]] named 'Model' in the Workspace.
!colspan="1"|SurfaceType
<pre>workspace.Model:BreakJoints()</pre>
!colspan="1"|Weld
!colspan="1"|Universal
!colspan="1"|Studs
!colspan="1"|Inlet
!colspan="1"|Glue
!colspan="1"|Smooth
|-
|rowspan="1"|<b>Weld</b>
|Weld
|Weld
|Weld
|Weld
|Weld
|Weld
|-
|rowspan="1"|<b>Universal</b>
|Weld
|Snap
|Snap
|Snap
|Glue
|No Joint
|-
|rowspan="1"|<b>Studs</b>
|Weld
|Snap
|No Joint
|Snap
|Glue
|No Joint
|-
|rowspan="1"|<b>Inlet</b>
|Weld
|Snap
|Snap
|No Joint
|Glue
|No Joint
|-
|rowspan="1"|<b>Glue</b>
|Weld
|Glue
|Glue
|Glue
|Glue
|Glue
|-
|rowspan="1"|<b>Smooth</b>
|Weld
|No Joint
|No Joint
|No Joint
|Glue
|No Joint
|-
|}
 
Brick Form:
<pre>
local brick = workspace.Brick
brick:MakeJoints()
</pre>
 
Model Form:
<pre>
local model = workspace.Model
model:MakeJoints()
</pre>


[[Category:Functions]]
[[Category:Functions]]

Revision as of 23:50, 23 September 2021

Function
Syntax BreakJoints( )
Returns n/a
Description: Breaks any surface connection with any adjacent part, including Welds and other JointInstances.
In Object: BasePart, Model


Example

This code will break all the joints contained in the Model named 'Model' in the Workspace.

workspace.Model:BreakJoints()