Complete Disaster with Unity

I have a game I have spent two months of my free time on, so about 60, 70 hours, and I was almost done with it. I have been backing it up by making a copy of a file called “Working Assets” (that holds all of my objects, textures, scenes, etc.) everyday.
Yesterday I made some changes in the game and somehow things stopped working right even when I tried to change back - no big problem at that time but I thought it would be easiest to quit Unity and take the “Working Assets” folder from that day out and replace it with the one from the day before.
I was shocked. My game is now 90% gone. The only thing left in the game is assets native to Unity - lights, cubes, etc. Everything is as it was in the Hierarchy, everything is there, but it is not in the game anymore.
If anybody knows how to fix this - !!!

Was you taking backups of only the Assets folder (and not Library as well)? Restoring only one of them and not the other can lead to corrupted state…

What do you mean that objects are in the hierarchy, but not in the game? When you select them in the hierarchy - does the Inspector show the right contents of the objects? Maybe it’s only the mesh assignments that got lost?

Anyway, you could take the whole project folder you have now, and send it via Report Bug.app (it can take arbitrarily large files).

Theres a library folder next to the assets folder. This contains the connection information for your assets. It needs to be kept in allignment with your assets, otherwise the project breaks. Most of us learned that the hard way. While some things are really easy, somethings are easy to break. ImportingExporting packages is the key to asset management, though it doesnt record custom input settings. In short, if moving a project, move Asstes and Library folders .

Theres also a file called __EditModeScene in the projects temp folder. Rename it to __EditModeScene.unity, and put it in youir assets folder. Double click it from within Unity and it may restore your project. Maybe. Good Luck
AC

Targos,
Thanks for the advice. I am afraid that EditModeScene didn’t change anything. I needed to know about the Library though.
Aras,
I did neglect to back up the Library (never again! - I just didn’t know about it).
What I mean about the hierarchy is that it lists all of the game objects that should be there, shows the right coordinates for them, shows that they were supposed to have scripts (actually the scripts are listed as missing but the variables are still displaying correctly!), etc. but the models are gone from the game and so are the textures and scripts.
I will work on sending it as a zipped file using Report Bug.app as you suggested. Is there a chance this can be fixed, or should I turn to trying to build it all again from the ground up?
Thanks

I don’t know; if you just replaced Assets folder than all these references (what model/texture/… to use) can be lost. You shouldn’t have to recreate everything from scratch, just assign textures in the materials, meshes in MeshFilters, etc. Of course that would be a lot of work, but less than rebuilding whole game.

Thanks for your response. That doesn’t sound too bad, but after trying it, I have had odd results. The model’s meshes are misplaced rather severely and some are not coming out the right shape or orientation. Is there something to be careful of that I am missing?
The models were made in Blender and some of them have several meshes. Before they were together as they should be but now they are coming out scattered. Is there a way to reassign the whole model instead of individual meshes?

You probably have to start again. The models themselves should still be intact.
AC

Yeah, the models are fine. And I have the scripts. It’s “just” the realigning and reassigning of everything…

I found out from OTEE that the case is hopeless, so I am turning to rebuilding things, but some of the meshes are not working even after being reassigned and some objects have so many meshes it is quite a jumble figuring out which ones to assign.

Is there no way I can replace an object in the game (the broken objects) with a model from the project window? The location of my objects is important as many of the scripts are location relevant so I need to place them in the right place and dragging objects into the game and then setting them with the position info the old objects had is tedious.
Any suggestions on that or other aspects of rebuilding games from people who have walked this vale of tears before?

there’s a script on the wiki that copies the transform of an object to another. i haven’t used it personally. don’t know if it will be of help in your case.

That sounds like it has potential. I’ll give it a look. Thanks.

This may, or (more likely) may not, be of help to you. I have an editor script that “reloads” maya files. What it does is that this:
First it finds all maya files in you project view.
Then it goes thought all the gameobjects in the hierarchy and if the gameobject is called the same as a Maya file it’s replaced with the file.

We use the script because we have a scene where all models lost their connection to their Maya files and it just wasn’t feasible to remake the scene.

Restrictions:
If you have other gameobject whose name coincide with a Maya file it’s replaced.
It doesn’t copy any scripts or components you may have put on the gameObject (remember that the entire subhierachy) is getting replaced
It copies transform values for sub-gameobjects on a name basis, so if your gameobject has multiple children with the same name and different transform values, some of them will be wrong.

The scipt must be placed in a folder called “Editor”.

(If you use something else than Maya, just change the 2 “.mb” strings to whatever you need).

[EDIT: Ups, I hadn’t noticed that it used a couple of custom scripts, everything should be there now]

30992–1132–$replacemayafiles_933.cs (3.44 KB)

Thanks, Talzor. I wish I knew enough to make stuff like that! I actually have a rather jumbled mess of names (I’ve learned to try to be more neat and methodical in my game making aproach from this experience) so I probably run into trouble with that but I’ll take a look and see what I can learn. The copyTransform script Pete mentioned is working well, actually, but my problem is I adjusted a lot of stuff in Import settings and so I need to go back and try to reset all of those as well - from now on I will adjust sizes within Blender instead in Import settings or I’ll try to use prefabs to a greater advantage.
I’ve found Unity really easy to use, but to use it well and “safely” takes a good bit more thought and care…

As I said this is most likely of no use to you. And I would hesitate to “learn” anything about neatness from it, as it’s just a jumbled mess thrown quickly together to solve a very specific problem. At most I’d use it as inspiration.