GetJointList

Constructor:

GetJointList()

Description

Returns an array (a number index table) that contains all physical constraints of the object. The array can be iterated over by using a number or a general for-loop.

Return Value

Type Description
table The table containing all physical constraints of the object

Examples

Create several parts and add physical constraints between them. Output the names of all other parts in the constraints with the specified part.

local p1 = RWObject.Create("Part") -- create part1
local p2 = RWObject.Create("Part") -- create part2
local p3 = RWObject.Create("Part") -- create part3
p1.Position = Vector3.New(0,10,0) -- set the position for part1
p2.Position = Vector3.New(0,15,0) -- set the position for part2
p3.Position = Vector3.New(0,20,0) -- set the position for part3
p1:CreateJoint(p2,JOINT_TYPE.SplitJoint) -- constrain part1 and part2 in the form of SplitJoint
p1:CreateJoint(p3,JOINT_TYPE.SplitJoint) -- constrain part1 and part3 in the form of SplitJoint
wait(1) -- wait 1
local wherelist = {} -- create an empty list
wherelist =  p1:GetJointList() -- retrieve all the parts in the constraints with part1
for k,v in pairs(wherelist) do -- output the names of all the parts in the constraints with part1
    print(tostring(v.Name)) 
end