-
What do you want to achieve? Keep it simple and clear!
I am trying to union all of the parts in a model together, and have many models. The code will be run as a command. -
What is the issue? Include screenshots / videos if possible!
I have written code that should definitely work, yet it does not union anything and does not throw any errors. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Here is my code:
for i,v in pairs(workspace.Model:GetChildren()) do
local others = {}
local basepart = nil
for j,w in pairs(v:GetChildren()) do
if j == 1 then
basepart = w
else
table.insert(others,w)
end
end
local newU = basepart:UnionAsync(others)
end
I am aware that UnionAsync is a working function, but I cannot get it working. I have tried running this code in a script and nothing happens there either.
Any help appreciated!