How to Negate and Separate Objects/Unions via Script Plugin

plugin:Negate{} Plugin | Documentation - Roblox Creator Hub
plugin:Separate{} Plugin | Documentation - Roblox Creator Hub
Separate will return the parts separated by it. Insert a table of parts into the method.
To separate a union using a plugin, the script would look like this:

local union = workspace.Union
local separatedParts = plugin:Separate{union}
union:Destroy()
for _, obj pairs(separatedParts) do
    local objClone = obj:Clone()
    objClone.Parent = workspace
end

Negate will negate the parts in the table, without you having to clone them.

I’ve seen people say that its impossible to do this, and there are very few search results for this. So I thought I’d write this.

4 Likes

No, this is a terrible way to do it. Why not use GeometryService? Using plugin does not work in-game.

GeometryService:UnionAsync(Part1, {Part2, Part3, Part4})
3 Likes

You’re right, it doesn’t work in game, and I don’t know why I wrote that. :grimacing: I guess the post might still be helpful, but Ill remove that part in it. Also GeometryService doesn’t allow you to separate, or negate parts. Unless I’m also wrong about that.

3 Likes

You are indeed wrong about that.

Just read the only four methods. Three of them are what you need.

if only i have looked for methods to union via script, i would have known about it :frowning:

So GeometryService (which i just found out now :slightly_frowning_face:) is a more convenient way to union objects? so when you call this function :point_down:

GeometryService:UnionAsync(p1, {p2, p3, p4)

does it place the p1 to it’s parent?

Not convenient, the only way.

If I understand what you’re asking, then yes.

1 Like