Error: Failed to unpersist: GameObject ID: 8963206 FileID: 1726582

Hey,
When I have multiple scenes opened at once using Open Scene Additive feature, I encounter into an unsettling problem.

When I enter and exit Playmode, these errors appear, all 707 of them. What’s much worse is the scene that have been opened using Open Scene Additive got gameobjects that suddenly disappear, as if it got deleted or something. Thankfully, if I don’t save the scene afterwards, I can recover the gameobjects by reloading the scene again.

Is there a way to make this stop happening? Atm I’m backing up like crazy at all times cus I don’t want to miss important gameobjects in my project.

Using Unity 2020.1.14f1

That’s weird… you aren’t changing Unity versions BACKWARDS are you?? Once you move forward in Unity versions you can never go back to an earlier version of Unity. Disappearing GameObjects and other mayhem usually ensue and your project can / will become damaged.

Another thing to try is to reimport all.

I’m sorry you’ve had this issue. Please consider using proper industrial-grade enterprise-qualified source control in order to guard and protect your hard-earned work.

Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).

You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.

As far as configuring Unity to play nice with git, keep this in mind:

https://discussions.unity.com/t/736093/3

Here’s how I use git in one of my games, Jetpack Kurt:

https://discussions.unity.com/t/807568/3

Using fine-grained source control as you work to refine your engineering:

https://discussions.unity.com/t/826718/2

Share/Sharing source code between projects:

https://discussions.unity.com/t/719810/2

Setting up an appropriate .gitignore file for Unity3D:

https://discussions.unity.com/t/834885/5

Generally setting Unity up (includes above .gitignore concepts):

https://thoughtbot.com/blog/how-to-git-with-unity

It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place.

“Use source control or you will be really sad sooner or later.” - StarManta on the Unity3D forum boards

Hey thanks for your answer. Yes thankfully I use Github and have tons of backups.

No, I’ve consistently used the same version.
It doesn’t seem to happen if the scene is set to “Set Active Scene”, only when it’s on additive mode. The same objects are consistently getting destroyed on Play exit. The ones I’ve marked on with “X” gets deleted on exit.

7981461--1024836--upload_2022-3-21_15-15-22.png

It’s worth noting these plugins I’m using: Playmaker, Masteraudio, Rewired and Easysave 3.
I think this problem started happening once I introduced Easysave few months ago in Desember, it initially used this scene saving system where it stored all objects in the scene in a manager. I had it removed due to being bothersome and performance heavy. Didn’t seem to go well with Open Scene Additive feature either, so I’m guessing something must’ve happened here.

Until now I’ve just tried to find ways around this bug, but what to do about it I’m not sure.

Another thing, IIRC, this error started happening literally the day after I made my first backup using Github Desktop app… I’m not sure if that’s an coincidence or not.

Bump

We have the same problem on 2021.3.21

We’re also having this error. I’ve submitted a bug report to Unity, so hopefully we’ll hear back from them sooner rather than later. This is quite a severe and blocking issue for us unfortunately…

Once I hear a response back I’ll be sure to post back here with an update.

Edit: So I’m not sure if this will be helpful for anyone else, but the cause of this issue for our project was a logic issue where I was accidentally changing the Prefab object itself during runtime, and not the instantiated copy of that Prefab, which then caused all sorts of bad reference issues in the Prefab object itself.

We are using like tons of different systems, So basically there is no way to track that problem? Or track what prefabs are changed? This is quite ridduculous :slight_smile: As I understand there will be change about that on side of unity? Why they allow actions that breaks scenes totally, in my opinion it is just abug and should be fixed. Did you maybe send them reproduction project?

Indeed there was no warning or error from the Unity Editor, and no way that I could tell which prefab it was that was being changed at run-time unfortunately.

For our project, it’s still early enough that we were only using a couple prefabs, and only one of them we were instantiating at runtime.

I’d look through your code and systems to all the places where you instantiate Prefabs and double check that you’re modifying the instantiated object and not the prefab object. (It might be easiest to search for all references to .Instantiate)

I did send them a bug report, with a clear and concise way to reproduce the issue 100% of the time, so hopefully this issue is fixed within the editor through a proper exception, error or warning when trying to modify a Prefab at runtime (which I believe is the source of the scene breaking bug).

It’s also entirely possible that your issue is different than ours was, and that the similarities were merely a coincidence of course.

Hopefully that helps :slight_smile:

1 Like

Thanks a lot. I think they didn’t added exception as it still happens on newest LTS. I will try that, but IMO Unity Should give a better errors about such a huge bugs like this.

1 Like

Good news! The Unity team has confirmed my Bug Report for this issue, and the issue is now marked as: Confirmed internally. Hopefully this means that they will patch this issue sooner rather than later. At the very least I hope that they implement a proper Exception type for this behavior so that it’s clear the developer is attempting to modify a Prefab Asset while in the Play Mode.

Good to hear that hope it will be fixed soon, Is that this issue? https://issuetracker.unity3d.com/issues/failed-to-unpersist-error-is-not-informative-when-trying-to-modify-prefab-in-runtime If yes please vote for it so maybe it will get higher priority. (but in my opinion, such giant bugs that destroy scenes should have like Highest priority.

Do you have any news on this? Did it solve it for you?

We’re using 2021.3.30f1 and we still have these corruption going on.
It might happen when instantiating things in awake or when moifying prefabs at runtime. But as there is no way to track it’s a bit difficult to solve (and our system is pretty large). it also might be due to a 3rd party.

Seems like its fixed in .31 but I need to test it more :slight_smile:

1 Like