How to recover invisible / corrupt unions

Introduction

This tutorial will walk you through finding and recovering your unions if they get lost / corrupted / turn invisible.

This method relies on trial-and-error, and works best if tried immediately after you’ve lost a union.

Background Information

When a union is created but before it or its place is saved, it contains child data - information about what it’s made of, stored directly in the place. When the union is saved to Roblox, a new SolidModel asset is created. The union instance in your place is then linked to this asset instead.

The invisible union issue appears to be caused by child data getting lost, causing something to fail downstream related to uploading the union, and thus the union instance becoming “un-linked” with its SolidModel asset (i.e. the assetid becomes null). Here is some more information.

The method in this tutorial is an attempt to “re-link” these unions with their last known good version. This tutorial is motivated by a sharp increase in “invisible unions” topics.

Because SolidModels are not normally visible or accessible to developers, this is tedious to do manually, so I’ve written a script to do the bulk of the process. The manual steps are still included in the collapsed section at the bottom of this tutorial for if you run into trouble.

Requirements / Considerations

  • This method will only work if your union existed in a place saved to file, published to Roblox, or was published itself as a model.

  • This method will not work if you lost your union without saving it or your place.

  • This method may not be feasible if you’re trying to recover a very old union, or you created many unions after creating the one you’re trying to recover. This method relies on trial-and-error, so there may be too many results for you to look through.

  • In some rare cases you can recover a union by separating it and re-unioning it. Try this first if you haven’t. Most often when you attempt to separate it, the whole instance will disappear, which is when this method is useful.

Summary

  • We will run a JavaScript script in our browser to generate RBXMX data containing all of the unions we have created recently.
  • We will paste this data into RBXMX files and import them into Roblox Studio until we find the desired union.
  • We can then separate and re-union the recovered union to fix its bounding-box and physical information.

Unfortunately, if you’ve already tried other recovery methods and this method fails for you, I don’t think there’s much else you can do to recover your work.


Instructions

1. Run the script to get your unions into the correct format

Note: If you are uncomfortable running scripts in your browser (you should be apprehensive), the older version of this tutorial containing manual steps for fetching your SolidModel assets is provided at the bottom of this tutorial.

  • Go to ItemConfiguration Api. This will not work on most other websites.
  • Open your browser’s DevTools (In Chrome, Ctrl + Shift + i).
  • Run this script in the JavaScript console.
    • You can set the initialCursor variable to the cursor string printed above the last output to continue from that page of results if you need more (e.g. 25_1_d7194f84f1e25fd24f82556daa888789).
    • You can adjust the howManyPages variable to control how many pages (i.e. test files) the script will return to you at once.
    • If you run this script too many times, or ask for too many pages, you will get rate limited and it will break. Wait a few minutes before trying again.
{
	let howManyPages = 1;
	let initialCursor = "";

	////////////////////////////////////

	let currentPage = 1;
	function request(cursor) {
		fetch(`https://itemconfiguration.roblox.com/v1/creations/get-assets?assetType=39&sortOrder=Asc&limit=25&cursor=${cursor}`)
		.then(response => response.json())
		.then(responseData => {
			let output = `<roblox version="4">`;
		
			responseData.data.forEach(asset => {
				let union = `<Item class="UnionOperation"><Properties>`
				union += `<Content name="AssetId"><url>https://www.roblox.com//asset/?id=${asset.assetId}</url></Content>`
				union += `</Properties></Item>`
				output += union;
			})
			
			output += `</roblox>`;
			console.log(`Next: ${responseData.nextPageCursor}\n------------------------------------------\n${output}\n`);
			
			if (currentPage < howManyPages) {
				++currentPage;
				request(responseData.nextPageCursor);
			}
		})
	}

	request(initialCursor);
}

2. Create RBXMX files for Studio

  • Download and use this empty file: TestFile.rbxmx, or create a text file and change the extension to .rbxmx.

  • Open the file in Notepad.

  • Copy all but the first two lines of text from the console in your browser and paste it into the file, overwriting everything inside. You must copy from <roblox version="4"> all the way to the closing </roblox>. Or it will not work.

    • There may be multiple blocks of text like this, you should only copy one into the file at a time.

    image
    image

  • Save the file.

  • Do this for each block of results in your browser’s console, creating a new file for each, or overwriting the old one once you’ve looked at it in Studio.

3. Import each file into Roblox Studio on a blank baseplate

  • Open Roblox Studio and open a new, blank baseplate.

  • Drag the RBXMX files into Roblox Studio and move the unions apart so you can see each of them.

    • Doing one file at a time is recommended, because they will contain 25 unions each.

Move onto the next step once you’ve found the union you were looking for.

4. Regenerate the union to fix physics

Once you’ve found your union, you’ll notice that it does not behave physically in the way you’d expect, and even has an incorrect bounding box. This is because unions store their physical information with their instance, and not with the SolidModel.

Thankfully, unions remember what they’re made of, so you can fix this pretty easily.

  • Separate the union.
  • Re-combine the union.

You should have now recovered your lost union.



Old, manual instructions

Introduction

This tutorial will walk you through using GET v1/creations/get-assets to find and recover your unions if they get lost / corrupted / invisible.

This method relies on trial-and-error, and works best if tried immediately after you’ve lost a union.


When a union is created and (it, or its place) is saved to Roblox, a new SolidModel asset is created. The union instance in your place is then linked to this asset.

This tutorial is motivated by the sharp increase in “invisible unions” that I’ve been seeing lately. The invisible union issue appears to be caused by union instances becoming “un-linked” with their SolidModel assets, so the method in this tutorial attempts to “re-link” these unions.

Because SolidModels are not normally visible or accessible to developers, this is kind of tedious.

Requirements / Considerations

  • This method will only work if your union existed in a place saved to file, published to Roblox, or was published itself as a model.

  • This method will not work if you lost your union without saving it or your place.

  • This method may not be feasible if you’re trying to recover a very old union, or you created many unions after creating the one you’re trying to recover. This method relies on trial-and-error, so there may be too many results for you to look through.

Summary

  • We will use GET v1/creations/get-assets to get a list of SolidModel assets created on our account
  • We will try replacing the AssetID embedded in a dummy RBXMX union file with each SolidModel AssetID, and import the file into Roblox Studio until we find the desired union.
  • We can then separate and re-union the recovered union to fix its bounding-box and physical information.

Unfortunately, if you’ve already tried other recovery methods and this method fails for you, I don’t think there’s much else you can do to recover your work.

Instructions

1. Fetch a list of your created SolidModel assets

  • Visit ItemConfiguration Api.

  • Under Parameters:

    • Enter 39 as the AssetType.
      • This is SolidModel’s AssetTypeId, which is undocumented on the DevHub. This value can be found by inspecting web requests on the website.
    • Set Limit however high you want. This controls how many results per page.
      • You likely won’t need to go higher than 25 if you’re trying this tutorial immediately after losing a union.
    • Leave other blank fields alone.
    • Leave cursor blank (for now).

  • Send the request and keep the results for Step 3.

  • If you need more results, the response will contain a cursor string
    (Eg. 10_1_c05f5a2de27925393fd9aaeba370f833).
    You can enter this string into the parameters list in the Cursor field and send another request to get the next page of results.

The results you get back from this request will be used to find your union.

2. Create a union to test SolidModel AssetIDs with

How to generate the test file yourself
  • Open Roblox Studio and create a new Baseplate

  • Create a union, anything will work.

    image

  • Save this place to a file on your desktop

    • This step triggers Roblox to upload a SolidModel, and will set up the instance so we can easily implant the SolidModel AssetIDs we found from the previous step.
  • Right click on the union you created in the Explorer window and select Save to File.

  • Save this union as a RBXMX file on your desktop.

    • This is an XML format, and is human-readable.

    image

The current easiest way to prepare a file for testing is to use this provided one. It is the most stripped down file possible, containing a prepared union instance, all you will need to do is change the asset ID number.

TestUnion.rbxmx (194 Bytes)

If this file ever stops working, likely just the version number in the header needs to be changed, but please let me know.

3. Test each SolidModel AssetID

  • Open the union RBXMX file you saved earlier in a text editor (Notepad should work, but I’m using Notepad++).

  • Find this line:

  • For each SolidModel AssetID returned in Step 1,

    • Change the AssetID in this line to a retrieved Asset ID and save the RBXMX file.

      image

    • If you wish to test more than one Asset ID at once, you can duplicate this entire block and change the asset ID for each duplicate.

    • Drag the RBXMX file into Roblox Studio and see if it looks like the union you’re looking for.

Move onto the next step once you’ve found your union.

4. Regenerate the union to fix physics

Once you’ve found your union, you’ll notice that it does not behave physically in the way you’d expect, and even has an incorrect bounding box. This is because unions store their physical information with their instance, and not with the SolidModel.

Thankfully, unions remember what they’re made of, so you can fix this pretty easily.

  • Separate the union.
  • Re-combine the union.

You should have now recovered your lost union.



Let me know if you run into any trouble following these instructions so I can improve them.

218 Likes
CSGV2 still gets corrupt unions
Invisible Unions Bug
How to prevent union loss due to corruption, and how it happens
Union invisible when pasted into a different place
Models not appearing
My Build Not Showing Up
Problem with Union
Is there a way to convert Unions to a mesh?
Union corrupts after publish
The Locksmith - Plugin for searching backdoors [3.0]
Anyone else having issues with unions not appearing in studio?
Why Union Models is not appear?
Unions not loading
Union operations disappearing although the transparency is set to 0
Union Invisible After Creation
Creations Page Public Beta 🤭
A section of my game suddenly got deleted?!
Studio Beta: CSG Has a New Engine - Vroom, Vroom, Vroom!
How to prevent union loss due to corruption, and how it happens
My parts are disappearing whenever unioned
My unions are disappearing when I publish them to ROBLOX
Unions disappearing when separating
Invisible models
Transparent parts (Union)
Allow us to view and insert our unions from the toolbox
Unions not appearing?
Largely Increased Number of Corrupt Unions, Solutions?
Why is my union invisible?
Union not here when loading in roblox studio
Invisible part in mesh and union
Completely corrupted unions? (AKA, stop being lazy, roblox. Take out your garbage.)
Deprecating Legacy CSG System
Union part literally disappeared and no longer there!
Union is invisible
Union disappears on seperate
Trees not rendering
Unions disappearing randomly
Failed to Upload Union: Exeeded Limit
Union Not Appearing In Roblox Player
Unions keep disapearing
Some invisible part glitch roblox studio
Some invisible part glitch roblox studio
My models and parts are Self-Deleting
Where are my unions?
Missing parts on my build
Model is not showing
Make it easier to access our Union library
Free helpful softwares and tools for all developers!
Can't union ANYTHING in my game

Wonderful tutorial! I don’t use unions since I’ve moved onto Blender, but I have wanted to go back and view some of my older unions since there wasn’t a way to search through them… Or so I thought! Wasn’t even aware that this API was available.

I’d imagine with this info revealed that there’d be work put towards making something which could smooth the process a little. All the pieces seem to be here to write something which could take an entire list of IDs and create a .rbxmx file which has your unions lined up, allowing for us to go through batches of 100 rather than one by one.

5 Likes

Somehow I missed this when scrolling through the DevForum. Not only is this incredibly useful but I would dare say it’s revolutionary. This type of fix for an issue so prevalent for many developers is amazing. Thank you for spreading this to the rest of us and I hope other developers will see this too.

6 Likes

no it ont work because when you open the corrupted union in note pad ++ the id line is this

Content name="AssetId"null/null/Content

You need to follow the instructions under section 2. The file you create in this step is for implanting SolidModel IDs into so you can test them in Studio to try and find your lost union.

You shouldn’t be opening the corrupted union; it’s gone and you need to find the last good version of it (a SolidModel asset) uploaded to your account. That’s what this tutorial helps you do.

1 Like

This worked, but I only found 1 union, how can I found the others unions?

If you chose a limit of 10 or greater for the API call and you only received 1 result, unfortunately the rest of your unions are likely unrecoverable, or may have been created by other users if you’re using Team Create. I’m not sure how this behaves with group games either, you may need to specify the groupID if this is a group game.

1 Like

This. Is. AMAZING!

I never knew it was possible to recover corrupted unions!
This is SOOO useful!

Thank you so much!

1 Like

I do all of that I save and it has disappeared again…

There is currently a bug where new unions turn invisible immediately after you publish/save. You need to restart Studio to see them but otherwise it looks like they’re okay (don’t try to undo to fix it, this will actually break the union).

2 Likes

Superb guide, thank you! You helped me to retrieve my work after 2 hours of solid modelling.

Many thanks.

4 Likes

This is super helpful! Helped me save a lot of work.

Quick note to anyone having problems: If you see < null> < /null> where < url> should be just edit the text to look like the picture. I don’t know why this happens (even with new, uncorrupted unions) but changing that to what it should look like worked fine for me.

1 Like

FWIW this is what the “Save this place to a file on your desktop” part of section 2 is for. Saving this file causes the union to upload, thus initializing this attribute on the instance correctly.

1 Like

This is really helpful :smiley:

Note: This worked to find a union I lost 2 days ago, just forgot this was a thing and figured i’d have to redo it.
Love this so much.

Simplified step 2 by providing a stripped down template file. Hopefully people will get less hung up on this part.

1 Like

Actually I just rewrote the entire tutorial to use a script so it’s not so tedious anymore.

4 Likes

Absolute godsend! Just recovered a few of my corrupt unions with the old method and worked like a charm! It was fun seeing some of my really old unions from way back when trying to find the one I needed. :+1:

1 Like

I have a question, would this method work with meshes too? I got some corrupted meshparts which are invisible but they have collision and have no transparency.

Meshes are only uploaded once and are not modified in Studio. Your files for MeshParts are external so there is no need for a recovery method. If your meshes are invisible, you probably just have inverted normals or they may have been moderated.

1 Like