Unite multiple parts. The parts involved in unite operation keep unchanged, and a new union object is created at (0,0,0) by default.


Variable name Type Default Description
partlist table Table of united objects

Return Value

Type Description
RWObject United object


Create two part objects. Unite the two parts and generate a new united object newp1 at the point (0,0,0).

local p1 = RWObject.Create("Part") -- create part1
local p2 = RWObject.Create("Part") -- create part2
p1.Position = Vector3.New(0,10,0) -- assign a vector to the part1 position
p1.Name = "p1" -- set the part1 name as p1
p2.Position = Vector3.New(0,15,0) -- assign a vector to the part2 position
p2.Name = "p2" -- set the part2 name as p2
local objlist = {p1,p2} -- put part1 and part2 into the same table
wait(1) -- wait 1
local newp1 = p1:UnionModle(objlist) -- unite the parts in the table into a new object
print(newp1.Name) -- output the name of the new part