Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug 2019.3.0f4 Terrible BUG, Lost all prefab's references and can not serializefield

Discussion in '2019.3 Beta' started by FcsVorfeed, Dec 31, 2019.

  1. FcsVorfeed

    FcsVorfeed

    Joined:
    Aug 15, 2014
    Posts:
    50
    When I upgrade Unity2019.3.0f4 and delete the library folder to rebuilt the project
    I lost all prefab's references which use Automatic serialization in the code

    Not only lost references, even I can not serializefield it again now
    when I try to serializefield the gameobject, you can see it never working(still null)

    It look like the GetComponentsInChild can not find the children objects in ProjectWindows but the code still running, before Unity 2018 2017 5.x it never happened, just in 2019.3

    I found if it's a Prefab Variant, and you will lost everything!!!

     
    Last edited: Dec 31, 2019
    Miguel_TagaiArts likes this.
  2. Miguel_TagaiArts

    Miguel_TagaiArts

    Joined:
    Jan 12, 2018
    Posts:
    39
    This seems huge. Have you filed a bug report? It should help a bit more given the current state of things.
     
  3. FcsVorfeed

    FcsVorfeed

    Joined:
    Aug 15, 2014
    Posts:
    50
    I already report a bug just now, this is really a serious problem

    It look like the programmers are using a very stupid and violent approach to optimizing Editor performance in 2019.3
     
    Last edited: Dec 31, 2019
  4. odysoftware

    odysoftware

    Joined:
    Jul 21, 2015
    Posts:
    84
    Hmm, I just upgraded to 2019.3.0.f4 and had the same issue at first - but it was because after reimport and reset of environment not all scripts compiled successfully - so it could not load those scripts - which is actual logical. Once I fixed the erronous script - all lost references were working again... - so I don't think it looses anything, but if there is at least one error it won't build the scripts and thus it looks like lost references...
     
  5. FcsVorfeed

    FcsVorfeed

    Joined:
    Aug 15, 2014
    Posts:
    50
    You can see the Video, there is not any error in my script, 0 info 0 warning 0 error,
    The problem is when I open the prefab, it look like serializefield successed, but in projectWindows, it still NULL
     
  6. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    This never really worked for me either and I also thought it's a bug, but then found an explanation why "that is by design", that I unfortunately can't find now.

    As far as I remember, it's because:
    GameObject's outside the Hierarchy (ProjectWindow, PrefabStage) are considered "inactive". You should use the overloaded GetComponentsInChildren method and pass "includeInactive = true" if you want to get a component from a GameObject outside the Hierarchy.

    If this behavior changed in 2019.3 though (which I believe it didn't), then it's worth to submit a bug-report because it would be a regression.
     
  7. FcsVorfeed

    FcsVorfeed

    Joined:
    Aug 15, 2014
    Posts:
    50
    You can see my code in the video , I'm very sure includeInactive = true
    This BUG is very terrible, because it may made the project error every where
    Unless you tell me tell me "DO NOT USE ANY GetComponentsInChildren IN EDITOR MODE"
    If it's true, why before unity 2018 2017 5.x 4.x It's working?
    I really need to change all of my script?please tell me, Unity technology team
     
  8. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I guess u can submit bug report.
     
    Peter77 likes this.
  9. guneyozsan

    guneyozsan

    Joined:
    Feb 1, 2012
    Posts:
    99
    Check if all of your MonoBehaviour class names match file names or if there are any appended MonoBehaviour classes without files. If there is a class-file name mismatch it does not give any compiler warnings but halts import when you reimport library.
     
  10. FcsVorfeed

    FcsVorfeed

    Joined:
    Aug 15, 2014
    Posts:
    50
    Is it fixed in 2019.3.0f6?
     
  11. SteeBono

    SteeBono

    Joined:
    Apr 4, 2015
    Posts:
    11
    Hello,

    something like this just happened to me.
    I updated Unity to version 2019.3.7f1 from version 2019.1.0f2 (just before releasing the game, crazy :p) because the build on Android didn't work.

    After that update, I opened the project.
    Unity has updated the project and more than 999 warnings and more than 140 errors appeared.

    It could not find references to UnityEngine.UI and UnityEngine.EventSystems (solved), then an error appeared regarding 'unity-jar-resolver' (solved) and finally when everything seemed ok (no errors and no warnings) I have started the unity player.

    As soon as unity instanced the GameObjects from Prefabs, nothing worked anymore, all the references on GameObjects were lost and all the parameters in my scripts have taken the default value. (among other things, Unity instanced the GameObjects with completely random rotations o_O).

    I checked the prefabs. All the references and parameters in the scripts were correct.
    I tried to update the prefabs changing the name of the parent GameObject in Prefabs (just to try to update the prefab) and everything worked correctly.

    Unity had probably missed references to prefabs in the project.
    With a simple update of the Prefabs, everything is back to normal.

    I hope it will be useful to someone :)
     
  12. PandaArcade

    PandaArcade

    Joined:
    Jan 2, 2017
    Posts:
    130
    What exactly does this mean?

    We just updated to 2019.3.14f1 from 2019.2.21f1 and on some machines references in prefabs have been lost but not on other machines o_O
     
  13. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    "update" in that contains probably means:
    • Right click affected prefab(s) in project window
    • Choose "Reimport"
     
  14. PandaArcade

    PandaArcade

    Joined:
    Jan 2, 2017
    Posts:
    130
    Thanks @Peter77 but it didn't work. We've had similar problems in the past where re-importing the prefab worked. We've also had a similar problem where we had to delete the prefab and revert it in Git.

    The solution for this problem that worked for us was deleting the library folder and having Unity re-import everything. This has worked on multiple occasions now on different computers. Maybe simply doing a re-import all would have worked, I'll try this next time.