Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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

1local part = workspace.Part1
2local otherParts = {workspace.Part2, workspace.Part3, workspace.Part4}
3 
4-- Perform union operation
5local newUnion = part:UnionAsync(otherParts)
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”." Xapelize 2658 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

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

01local part = workspace.Part1
02local otherParts = {workspace.Part2, workspace.Part3, workspace.Part4}
03 
04-- Perform union operation
05local newUnion = part:UnionAsync(otherParts)
06newUnion.Parent = workspace
07 
08-- Removing original parts
09workspace.Part1:Destroy()
10workspace.Part2:Destroy()
11workspace.Part3:Destroy()
12workspace.Part4:Destroy()
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 Xapelize 2658 — 3y
0
oh wow i literally forgot to parent the union Lol I Thought It was gonna do smthing else kidsteve923 139 — 3y
Ad

Answer this question