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 2 years ago

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)
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 — 2y

1 answer

Log in to vote
1
Answered by 2 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

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()
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 — 2y
0
oh wow i literally forgot to parent the union Lol I Thought It was gonna do smthing else kidsteve923 139 — 2y
Ad

Answer this question