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

Object references become 'Missing' after building the game

Discussion in '2018.3 Beta' started by Prodigga, Sep 27, 2018.

  1. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Hi there

    We noticed that after building the game (Atleast, we think that's what causes it!) some object references become 'Missing'.

    When I find the object in sourcecontrol, I can see that it has been reserialized and all the FileID's have changed within that prefab. If I discard these 'changes', whoever was referencing it goes from showing 'Missing' to not missing anymore.

    I am having trouble reproducing it.

    It also only happens on a few fields on certain objects. Always the same field and always the same object. Its really strange.
     
  2. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Here is the missing reference:
    bug1.PNG
    Here is what source control shows. The ID's have all changed and gone strange?

    bug2.PNG
    Here is me discarding the changes:
    bug3.PNG

    Now the reference is back:
    bug4.PNG
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Thanks Prodigga, as soon as you figure out how to reproduce it, it would be very helpful if you could submit a bug report with reproduction steps for the issue.

    Edit:

    The issue is known and will be fixed soon. Current estimate is b5.
     
    Last edited: Sep 27, 2018
  4. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Hey @LeonhardP

    Having trouble reproducing this issue. I am not sure if it is the same issue, but we have this problem in various places manifesting in different ways.

    • The issue I've mentioned above appears in a few places in our project, but always the same place. I have not yet figured out how to force unity to 'reserialize' the assets and screw up the FileID's.. It just 'happens' sometimes. I am still trying to reproduce it.
    • Some particle systems (always the same ones) will have the Mesh in the Renderer module set to 'None' when being from our pool and activated. To initialise our pool, we disable the prefab gameobject (to supress OnEnable/Awake/Start messages for the instances we are about to make), we instantiate a bunch of copies and place them under a disabled null. When the object gets taken from the pool, all we do is re-enable the object and unparent it. I am explaining this because what we are doing isn't anything too 'crazy'. Its very basic stuff. But this (for some reason) causes the Mesh in the Renderer module to become 'None'. If I select the disabled/pooled version of the prefab instance in the hierarchy, I can see that the Mesh value is setup correctly. It has a valid value. If I manually drag the instance out of my pool hierarchy, and enable the object, its fine. But if I do these exact same steps via code, the Mesh value becomes 'None' for some reason. What makes this stranger is that, again, this only happens on the same few particle systems. Also, it may be important to note that it says 'None' - not 'Missing' as with the first issue.
    • The 2 issues above appear in prefabs that existed pre 2018.3 Beta. They were 'upgraded' to the new prefab system. And since these issues always appear on the same prefabs and on the same fields, it would be logical to assume that something 'screwed up' during the upgrade process.. That leads us to case number 3... We have a prefab generation 'pipeline' in place. We can delete certain prefabs from our project and our pipeline can regenerate them from scratch. This is awesome in this case because it seems like our issues stem from an 'issue' with the 'upgrade' process from 2018.2 > 2018.3 ,right? Just regenerate the prefabs in 2018.3! So we did that..and we still see the issue on some prefabs. It's always the same prefab, and always the same field... In this particular case, we generate Prefab A, we generate Prefab B, a script on Prefab A is set to reference Prefab B. When I open up Prefab A in 'Prefab Mode', everything is fine. The behaviour on Prefab A has a valid reference to Prefab B. I hit play..everything is fine. I build, everything is fine! But then.. 'randomly' (I haven't yet figured out what is 'triggering' this issue either).. the reference to Prefab B in Prefab A will become 'None'... Again, it may be important to note that it says 'None' - not 'Missing' as with the first issue. Unlike Issue #2 however, if I open up Prefab A in 'Prefab Mode', the reference is still 'None'. It's 'completely' lost. Whereas in Issue #2, the particle system's renderer module showed that there was a valid value for 'Mesh', up until the moment I activated it by code which is when it becomes 'None'.
    I think issue 1 is its 'own thing', and issue 2 and 3 are more 'similar' to each other, but still not sure if it is the exact same issue..!

    I am still trying to reproduce these issues, but they are concerning, most concerning is issue #3, where the prefabs are 'freshly generated' (ie the old versions were literally deleted, and they were re-created from the ground up) yet they exhibit the same issues as before - the same object, same scripts and same field within that script becomes set to 'None' 'randomly'.
     
    LeonhardP likes this.
  5. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Oh I just noticed your edit.. Lucky I re-read your post!

    We'll, hopefully all of these issues stem from the same thing. I'll leave my post up anyway, and we'll see what happens in b5.
     
  6. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
  7. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Hey, I don't know if its the same thing but I forced unity to 'reserialize' everything by changing the serialisation mode to 'Binary' then back to 'Force Text'. I wanted it to touch everything in the project so it could reveal which prefabs exactly were broken. However, this didn't reproduce the issue(s). Everything was just fine.. :confused:
     
  8. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Hi, we just noticed that the changelog for b5 contains only 3 things. We were wondering if there are 'other changes' (bug fixes, changes to improve stability, etc) that just aren't noted, or if this beta version literally just contains 4 changes.

    We are asking because we were waiting for these fixed, and not sure if they hit b5 or not.
     
  9. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Yes, that fix is in b5. It missing in the release notes is not on purpose. Thanks for pointing this out!
     
  10. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    The reason the rest appears so thin is because of the layout.

    All of these are actually new since b4. I'll point this out internally.
     
  11. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Ok thanks, there are other oddities with the change logs - a random example: In b4's changelog, there is an entry under '2018.3.0b4 Entries Already Released in 2018.2':
    • Animation: Fix regression when changing hierarchy under an Animator (1080559)
    When we look at the b5 changelog, we would expect to see this under 'Preview of Final 2018.3.0b5 Release Notes'. Maybe not under that specific heading, but atleast somewhere on the page, right?. But there isn't even a single mention of issue 1080559.
     
  12. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
  13. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    Hello,
    we experienced this issue too but we don't take the time to test it in b5 due some issue with the version.
    Btw thanks for the report and the potential fix in b5 (if it's truely fix and the same)
     
  14. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    This is by design to reduce their size. The final release notes don't include entries that were already published in an earlier version or entries that were specific to the published version and fixed during its beta.