Search Unity

Prefabs created on 2018.2 loose data when dragged to hierarchy

Discussion in 'Prefabs' started by georgeq, Sep 12, 2018.

  1. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    After upgrading from 2018.2 if you open a prefab from the project window, all the scripts show the same data they had on before the upgrade, however if you drag the prefab into the hierarchy they are blanked, the same thing happens if you try to instantiate the prefab from a script.
     
    TokyoWarfareProject likes this.
  2. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    Last edited: Sep 13, 2018
  3. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    I solved it by dragging the prefab into hierarchy them copy the component on the project's prefab, pasting the component values on the hierarchy and finally applying all overrides.
     
    LeonhardP likes this.
  4. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    looks like a nice temporal workaround, but my prefabs are pretty complex with gazillion of components I'll have to wait fore a fix, but for smaller things this can be solution
     
  5. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Thanks for reporting this issue TokyoWarfareProject,
    Did you see the reply from QA?
     
  6. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    Hi yes.

    Sorry, during weekI try to work as much as I can despite I may report a bug, following up to request requirese time, like hours and that breaks production.

    I was testing right now, I was surprised to see QA not being able to reproduce. So I did export again to a package a new asset sthat has plenty of scripts that I've tested to break in the wholy porte project.

    And to my surprise, when dragged into the scene, IT DOES PROPERLY reference all the stuff as shown in the project view. I'm going to do some further tests.

    What I did now was to from 2018.3 ported project where it breaks, export package and open in 2018.3.


    I'll expot same prefab from 2018.2 and import in 2018.3 and see whot happns.

    If it works, it may be a project configuration issue that gets glitched on teh 2018.2 to 2018.3 porting. I'll keep you updated.

    edit: answered the mail
     
    Last edited: Sep 15, 2018
  7. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    OK, more into this.

    I did duplicate 2018.2 project

    deleted "library" then I iupgraded to 2018.3 .

    Issue remains.

    Striping down levels to leav a level that will help me also on another bug I reported and that they seem not be able to reproduce. (probably due to engine version used).
     
  8. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    @georgeq, currently u can try to change one reference or variable then change back to initial value then save it to update the prefab. It should fix the bug.
     
  9. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    I'll checkm but I've gazillions of prefabs in the project.
    I've just found out that if you duplicate the prefab and you drag the duplicate also works. Probalby same principle as you pointed tho.
     
  10. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    Duplicating won´t work in complex prefabs with multiple childrens with scripts, actually it seems to mess the things up :\ packing up repro project.

    uploading,
    looks like it wiill be by monday. or may be late sunday.

    QA team has been issued a mail with repro project and testing notes.

    Case 1080570
     
    Last edited: Sep 16, 2018
    LeonhardP likes this.
  11. charlie_sbg

    charlie_sbg

    Joined:
    Dec 18, 2016
    Posts:
    13
    Same problem upgrading 2017.x to 2018.3.3f1. I'm trying not to upgrade even further on speculation as this was supposedly fixed after beta. As a workaround, similar to what was reported above, I open a botched prefab (I have lots!) and just disable/enable some script in it to cause it to "refresh" if that makes sense. (the components and values look correct in the prefab but will not play that way) Then the prefab is wholly changed to the new format and it's ok.

    I've noticed on occasion that a prefab is "zeroed out" on me and I have to bring it back from source control :( My best guess is that this happens in run mode (in editor) when a prefab was not manually updated. Unity goes ahead and saves default values (0s, empty arrays, etc) over the prefab.
     
  12. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    814
    no men, the fix is that you search by type in your project tab, by "prefab" type, select all and check em to "reimport" DO NOT do "reimport all" option, aparently that one wont work.

    upload_2019-4-29_19-41-9.png