Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Out of no where : SerializedObject target has been destroyed

Discussion in 'Editor & General Support' started by FirstTimeCreator, Sep 6, 2018.

  1. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    768
    So i was working and building my game and I went to build and run to test and all of the sudden I am getting
    4 of these errors on build:

    "SerializedObject target has been destroyed.".

    I can't find anything that I did that would cause this and it seems impossible to find the issue that is causing it. The game is playing just fine in editor with no errors.

    I have created a new scene and tried to build and i still get the errors.

    It appears to have something to do with generating shader varients? I am not sure.

    Any suggestions on how to debug this? I have not the slightest Idea what would cause it as I did not do anything major to my project other than editing classes that and files that I created.

    I am at a loss here other than trying to revert to the last version of unity and doing a re-import, I don't think this problem is related to my project.

    I have a backup from yesterday but I am not to excited about losing 9 hours of work, or at least trying to setup everything I did.

    I am using Unity 2018.2.6
     
    Last edited: Sep 6, 2018
  2. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    768
    I revered to the previous version and still I am getting the errors.

    Now im going to start walking back everything i did today and try to find out what the hell is going on..
     
  3. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    768
    That was just weird.

    The only way i could fix it was by rebuilding the project by re-importing backup folders that contain my scripts.

    Some sort of editor gltich.
     
  4. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    That looks like it's most likely an editor bug to me, which will not cause any issues for your built game unless the editor bug causes an object to lose a reference or value saved to a scene or prefab (I find this very unlikely).

    I think you may have had something fishy in your Library folder. Strange editor bugs can often be fixed by closing the project and deleting your Library folder or re-importing your assets folder.

    Hope it stays fixed for you.
     
  5. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    768

    Oh im definitely going to make more frequent backups.

    That sort of thing rattles the nerves.
     
  6. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    768
    I am able to build and run now but i am getting:

    "Failed executing external process for 'clustering job'. baking RTGI.
     
  7. nathanwick

    nathanwick

    Joined:
    Jul 18, 2017
    Posts:
    2
    I had the same problem. It's an editor error. I closed the editor and reopened it. Then everything was normal again.:)
     
    A_Marraff and unity_15234105539 like this.
  8. OneNot

    OneNot

    Joined:
    Jan 26, 2018
    Posts:
    4
    I haven't found anything recent about this, but I get this quite often on version 2019.1.1f1.
    Restarting Unity always fixes it, but it comes back at random. I'm not sure if it actually breaks anything or not, but it sure is annoying.
     
  9. TaimoorMazhar

    TaimoorMazhar

    Joined:
    Jan 3, 2020
    Posts:
    4
    The issue is with you Free Aspect this is the screen resolution option. if you switch to free aspect then
    "SerializedObject target has been destroyed." error removed
    Thanks.
     
    yuvalko likes this.
  10. Elvin-Hillbird

    Elvin-Hillbird

    Joined:
    Nov 15, 2012
    Posts:
    13
    I sometimes get this error too. "SerializedObject target has been destroyed." I use version 2018. 2. Closing and opening Unity fixes it. When this error happens, if I change to another program from windows task bar and go back to Unity, it gives two more of this error.
     
    A_Marraff and Mark117 like this.
  11. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    137
    Yeah I noticed this pops up when you do that. It's a bug that's been around for ages.
     
    A_Marraff and Harry_Drew like this.
  12. Erdal42

    Erdal42

    Joined:
    Sep 17, 2018
    Posts:
    19
    Wow thanks! Definetely weird but works...
     
  13. FelixLightshape

    FelixLightshape

    Joined:
    Nov 25, 2019
    Posts:
    9
    I have this issue on 2019.2.21f1. Literally 5 minutes before the error I built my project without problems but after I changed a few minor things in the scene, this error now appears every time I want to build. Deleting the library folder or restarting Unity don't help unfortunately.
     
  14. djstatika

    djstatika

    Joined:
    Jul 6, 2017
    Posts:
    4
    anyone here via google: Try going into Window > Rendering > Lighting and switch off auto generate, then click generate. But also make sure theres no unintended cubemap in the environment settings
     
  15. AdrianRhesa

    AdrianRhesa

    Joined:
    Jul 19, 2018
    Posts:
    4
    Got this problem too. I found that when I change my test model prefab to a production prefab and copied all the components from the test model prefab. The test model prefab actually has some reference to its own child gameobject. I think this reference while not in used produces this errors when I instantiate the new production prefab.
     
  16. absurdnoize

    absurdnoize

    Joined:
    Nov 23, 2019
    Posts:
    10
    Getting this error on 2019.4.1f1, relaunching the editor didn't fix.
     
  17. solankeygss

    solankeygss

    Joined:
    Nov 27, 2022
    Posts:
    1
    I got the Solution :) -

    this is because of Inspector
    if you have something selected and it got destroyed (maybe with DontDestroy),you got that error
    error come through over and over again whenever you Hover over inspector!!
     
    vannlife and A_Marraff like this.