Greetings, I need help with creating an independent part made out of thousands of parts while the game is running. I’ve tried to make a union, but when there is a lot of parts, I get an error in the output:
“Something went wrong. CSG returned error code -14. Please file a bug report, preferably with a file containing the problematic object(s).”
I also tried to substract the whole model from a big part and then substract this bigpart with another big part. But I get the same Error message…
Script
The Code:
for i, v in pairs(model:GetChildren()) do
table.insert(partstable,v)
end
local union = partstable[1]:UnionAsync(partstable)
union.Parent = workspace
Based on the error message you received, it seems like the issue is related to the CSG (Constructive Solid Geometry) system in Roblox Studio, which is used to create unions, differences, and intersections between parts. The error code -14 indicates a CSG failure, which could be caused by a variety of reasons such as overlapping geometry, non-manifold geometry, or too many parts being used.
To create an independent part made out of thousands of parts while the game is running, you could try using the WeldConstraint instead of a union. The WeldConstraint will allow you to connect multiple parts together while maintaining their individual properties such as mass, friction, and collisions.
I’m looking for a way for simplifying and optimizing the model. I also want to detect when a player is stepping on the model and when it stops stepping on it.
the CSG tends to have low performances so what i suggest is doing it in cycle, and not everything at once. it would take a bit more time but at least it wouldn’t crash.
for example :
i have 1000 part
union 100 part x 10
union the 10 resulting part
Ok I’ve tried this, but it doesn’t work, the unions can’t be joined. Error:" Something went wrong. CSG returned error code -6. Please file a bug report, preferably with a file containing the problematic object(s)."
Like, create the mesh, then put it somewhere you can pick it up later, and once done delete the model containing the part and parent the mesh to the workspace
Try breaking it down, combine each n (ex. 10) parts into a union, then recursively call the function that combined them so that it combines another n parts (randomly) and when there’s less than n, make it combine all the parts there, should theoretically work.