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.
- You can set the
{
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);
}
-
You should be left with output in your console that looks like this:
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.
-
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).
- Enter 39 as the AssetType.
-
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.
-
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.
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.
-
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.