Ability to separate UnionOperation classes into their component parts

Issue

It is currently too hard to manipulate UnionOperation classes via code. As unions are functions of the BasePart class, we have BasePart:UnionAsync(), BasePart:SubtractAsync(), and even the new BasePart:IntersectAsync(). However, a method to separate unions via script does not exist.

Use Case #1

The first use case for adding a separate method is to deconstruct unions in lieu of creating an explosion for shrapnel. By deconstructing the union into its component parts and then using the Explosion class, a shrapnel effect is obtained. Of course, this is dependent on the size and number of parts that make up the union.

Use Case #2

The second use case for adding a union separate method is to change or reconfigure the union in real-time. Some games use unions for map elements and being able to change the unions facilitates the use of randomly generated maps if large parts of the map are made of unions.

Use Case #3

A third use case was mentioned in this thread where someone wanted to generate a minimap using tiles, but it couldn’t be done because of unions. I don’t know if the original poster solved their problem or not.

Conclusion

If this feature is implemented, it will not only complete the UnionOperation API, but it will also facilitate the above mentioned use cases and allow another avenue of creativity when developing experiences on the platform. As it stands right now, the API is not complete since we can negate parts, combine them into unions and intersections, but we can’t separate them.

13 Likes

There is, actually. But it’s plugin only. So I do agree we need a SeparateAsync() too.

I believe this limitation was implemented because only Studio can access post-union data.

2 Likes

I believe unions themselves dont store information of parts and unions are stored in roblox’s asset delivery, but im not sure why we’re restricted from doing that in runtime. It does obtain data from somewhere when separating in studio, eh?

I don’t know what, if any, technical limitations as to why this cannot be done. I do know that unions seem to store all the parts that make them up though. We all know that Studio can do it. I find it strange that we can create unions by script but can’t undo them.

We need this. It’s stupid how they added the :IntersectAsync() method, but is still leaving out the :SeparateAsync() method. If it’s impossible to add for whatever reason, there should be transparency for that.

3 Likes

Bump! There is still no way to separate, unions at runtime despite this being requested over 3 years ago.
In a golf game I want to make, I want to have an undo system to remove holes in the ground (which I would add via GeometryService:SeparateAsync()), but I can’t undo this easily.

Seperation should be a very fast operation if the history state is saved, my only theory is that the history state isn’t preserved when loading a game to reduce file sizes.

But then seperation wouldn’t work in Studio after the first save, so I’m not sure why it doesn’t exist.

@RealChuube @metatablecatmaid

Since I first made this post, I have learned why there is no separate by script. The problem is that for unions in the live server, only the actual union mesh geometry is sent to the client. This history of all the meshes that make up the union are suppressed. I actually discovered this by accident when copying union in studio from the CLIENT which broke the copies. The server does maintains this. So the bottom line is that it cannot be done for data storage and performance reasons. You can read about it here:

When separating a union part, error code -6 is returned.

So my theory is correct, it would be really expensive to keep the entire history state when running a game that might have 1000s of unions.

they are looking into possible solutions for this: