Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity crashes when attempting to load a scene

Discussion in 'Editor & General Support' started by jtsmith1287, Apr 24, 2015.

  1. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    I've experienced this bug twice now and have reported it twice. If a prefab or object in the hierarchy of a scene becomes corrupt for whatever reason (meta file corrupted, prefab deleted from resources, etc) all of Unity crashes. I just pulled changes from the repo, merged them and boom. Now I can't run the game. I can't build, I can't load the scene in the editor and I can't play the game in the editor. Unity crashes to desktop without warning as soon as it tries to interact with this scene.

    What seems to cause this is when the prefab is placed in a scene in the editor, and then some part of that used prefab breaks.

    Has anyone experienced this and discovered a workaround? Unity doesn't seem to be prioritizing this bug despite the fact that it's a complete show stopper. I'm dead in the water until I can figure out what's up.
     
  2. soranthalas

    soranthalas

    Joined:
    Feb 1, 2014
    Posts:
    3
    Experienced the same behavior in the past with no obvious rhyme\reason. Had to rebuild the scene; fortunately, my scenes are rather simple so far.
     
  3. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    It took us several hours to resolve this, but we had to reset our branches and work together to go over each and every line in the meta files to make sure the merge happened nicely. After doing this however our objects in our scene were completely reset and we had to add references back in. I think this goes to show that the inspector isn't good for building objects. It's just good for viewing. If you need to make changes, do it in code.

    Also, prefabs and scenes merge horribly. It seems like Git has no clue what to do with these (I have the editor set to forced text and visible meta files). What happened here was an object was edited by multiple people and standard merge conflict practices aren't enough to ensure nothing horrible is going to happen. So to circumvent this we're establishing a stricter ownership of objects in scenes. While this is going to force us to take more time with communicating changes, it'll likely save time hassling with manual merging. It would be really cool if Unity didn't just explode if a single line in a meta file was bad. I would think that a more elegant approach would be to disable a corrupt object and explicitly inform the user which object is correct, and even give a line number in a meta file if possible. Version control is key to projects like this. Unity should handle it better.