Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How Do I Seperate A Union And Then Union It Again?

Right Now Using Union Script From Roblox But Turns Our It Also Dosent Work

local part = workspace.Part1
local otherParts = {workspace.Part2, workspace.Part3, workspace.Part4}
 
-- Perform union operation
local newUnion = part:UnionAsync(otherParts)

1 comment

0

i know this is answered but roblox said this which is better than all my explanations: "The resulting union instance will have a null parent and will be named “Union”."

1 answer

✓ Accepted answer

Roblox is dublicating parts when using BasePart:UnionAsync(). It is similiar to Object:Clone() so first of all you need to assign a Parent for newUnion. You can remove parts or hide them if you want to use them later.

Example

local part = workspace.Part1
local otherParts = {workspace.Part2, workspace.Part3, workspace.Part4}

-- Perform union operation
local newUnion = part:UnionAsync(otherParts)
newUnion.Parent = workspace

-- Removing original parts
workspace.Part1:Destroy()
workspace.Part2:Destroy()
workspace.Part3:Destroy()
workspace.Part4:Destroy()

2 comments

0

you could parent all the parts to nil, so its still in the memory but people cant see it, this is still a good solution

0

oh wow i literally forgot to parent the union Lol I Thought It was gonna do smthing else

This discussion is preserved as it was. New answers, comments, and votes are closed.