Unions - (Roblox) Implementation Questions

My theory on how Unions “work” in the background:

Say I make one UnionOperation, and then I copy it around in my Roblox place.
It seems as though when I publish my place to Roblox, some kind of representational “mesh” or “data” file is generated that stores the information for that Union, very similar to a Mesh file. That way when a player joins my game, they just download that single Union info file, and then all the “copies” just need that “UnionId”-reference and their geometry information to load.

Question #1 - Is the above description a close approximation of how Unions work? If not, would appreciate an explanation.

Question #2 - If there is a referenced “Union” file with a unique Id, it would be amazing to be able to use it in the same way we use Mesh Id’s on MeshPart’s.

My use case is being able to quickly replace a lot of the same “Union” in my game, with an updated version. My only way to do it now is a script that can somehow identify the existing Unions, make a copy of the new updated one, and then attempt to correctly reproduce positioning, other settings like anchored/cancollide, and also handle any welds or anything that were made on the original “Union”

Answer to Question 1.

This is called Instancing. It’s works as you described for all asset file types including sounds, textures, meshes, Unions, Parts, and anything else I’m missing.

Answer to Question 2.

Currently I don’t think that’s possible. Packages are a relatively new feature that updates assets across a game, but I don’t know if they work with Unions since I don’t use Unions. It’s worth reading up on the feature to learn more.

2 Likes

Hadnt even heard of packages, thanks