Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
9
Question by Krillbite-Studio · Feb 06, 2018 at 03:34 PM · unity 5scripting problemerroreditorscene

Failed to unpersist: MonoBehaviour ID and then unity destroys our scene.

On random occasions, when going to and from playmode, everything in our scene gets deleted. You end up with just a blank scene.

We also get a lot of these when this happens.

Failed to unpersist: MonoBehaviour ID: -406172 FileID: 1298162478

(Filename: C:/buildslave/unity/build/Runtime/Misc/SaveAndLoadHelper.cpp Line: 631)

Failed to unpersist: Transform ID: -406170 FileID: 1298162477

(Filename: C:/buildslave/unity/build/Runtime/Misc/SaveAndLoadHelper.cpp Line: 631)

We're on Unity 5.6.5f1

Is there a way to fix this issue or do a workaround? Or better, does anyone know why this happens?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Harinezumi · Feb 06, 2018 at 03:43 PM 0
Share

$$anonymous$$aybe it's this issue, fixed in 2017.1? :/

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by raxter · Feb 06, 2018 at 04:20 PM

For extra context (I'm working on the project that has the problem): It only happens when you exit playmode and go back to the editor. It happens, seriously, seemingly at random. Saw that some person had a problem with selecting things then playing and it showed up so we've tried everything and every combination of selecting things in the editor then stopping, then deselecting things, stopping, pausing stopping etc etc etc we have no clue what causes it but it's nothing straight up obvious. Really tricky to debug since we can't recreate it, not until it destroys the scene and we loose our work(!)

It seems to affect certain scenes so we also suspect that maybe the scene file is corrupt in such a way that it works 98% of the time and immolates itself somehow for the other 2% but we have no hard proof of this being the case either

We have a custom hierarchy drawer but we get no errors from it at all. it's pretty odd so even if you have some of your own experiences that would be helpful ^ _ ^

(note: we've made a scene backup on play system as a workaround so our data is ultimately safe but we would prefer to figure it out properly and avoid having to restore from backups if possible :)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

Answer by punk · Jan 20, 2019 at 08:43 AM

Ok - This problem has been plaguing me for a few years now and a few days ago I decided enough's enough and today I finally found a solution. I'm putting it here in hopes it will be of help to someone.

I believe there is a bug in Unity's internal scene code somewhere , probably scene or prefab serialization (I don't think it's a corrupt file). In my case the root of the problem was my own pool manager.

For me It seems specifically it was caused by using an 'Instantiate' command inside an Awake function suggesting that the scene is not ready for Instantiation at that point. When the prefab was added to the scene it seems it invalidates the prefab and then destroys it. When the prefab becomes invalidated it also invalidates the parent game objects all the way up to the root of the scene and since I have a habit of putting all my game objects into a single parent game object on the root, this made it seem like the whole scene was getting deleted (which is was).

This would happen either on pressing play or on pressing stop.

When I moved my Pool Manager out of its parent and into the root of the scene I noticed it was only the Pool Manager and it's associated game objects that were getting deleted, because I was putting the Instantiated prefabs inside them.

Long story short after moving the Instantiate function to a later stage in the game cycle I've completely eradicated the problem.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Deeeds · Sep 23, 2019 at 11:16 PM 0
Share

I haven't tried this, yet. But already can't thank you enough. I am doing pooling, it is my own pooling system, some of it occurs on the root scene, some in the secondary scenes. The only difference in our scenarios, my pool creation and instantiations is all done in Start, not in Awake. I'll make a custom initialiser that waits some time before doing the pool creations and instantiations and see how that goes.

THAN$$anonymous$$ YOU!!!

avatar image
0

Answer by BinaryEclipse · Dec 17, 2018 at 03:44 PM

I've noticed this as well. It only happens when I lock my inspector on an item, oddly enough EDIT: On 2018.3

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

236 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

UniRPG Error cs0121. 0 Answers

Universal Level Changer with SceneMnager 1 Answer

Getting an error while trying to get scene name 1 Answer

The type or namespace name `SceneManagment' does not exist in the namespace 1 Answer

Built project, now scripts are missing. 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges