You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to make a hole in a wall with a script. -
What is the issue? Include screenshots / videos if possible!
Whenever I try to union negative parts and a normal part in roblox studio using a script, the negative parts turn positive. Here’s a clip:
https://youtu.be/bu8ytW8Q3qA - What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked on the dev forum, nothing.
I have tried to create the negative parts using a script, but when I did that it gave me error -25 when I tried to union them
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- Code I used for the script
-- // Variables
local negativeModel = workspace.Negatives
local negativeParts = {}
local mainPart = workspace.UnionPart
-- // Add parts to table
script.Parent.ClickDetector.MouseClick:Connect(function()
for v, i in pairs(negativeModel:GetChildren()) do
table.insert(negativeParts, #negativeParts + 1, i)
end
-- // Script
local union = mainPart:UnionAsync(negativeParts)
union.Parent = workspace
union.Name = "UnionedPart"
mainPart:Remove()
union.Anchored = true
table.clear(negativeParts)
for v, i in pairs(negativeModel:GetChildren()) do
i:Remove()
end
end)
If you know how to fix that, please reply.