Search Unity

Unity 2018.3 Prefab Lose Reference

Discussion in 'Prefabs' started by mleesago, Apr 12, 2019.

  1. mleesago

    mleesago

    Joined:
    Jan 18, 2017
    Posts:
    10
    Our team is using Unity 2018.3.9f1+ and have recently encountered a bug where some of our prefabs that have references to ScriptableObject is losing reference when instantiated, like during runtime or dragging one of the prefabs into a scene. In the preview we can see that they still hold references to ScriptableObject. So if we do a reimport of those prefabs then that fixes the issue and the references to ScriptableObject persists.

    Weird thing is, after doing the reimport and try saving the project, git does not see any diffs for those prefabs. And after that, we even tried deleting the library and any temp folders inside the project thinking that would maybe take those prefabs back to the broken state but they remain fixed after opening the Unity project again and still hold references (during runtime and instantiating in a scene). We even tried disabling the cache server but that doesn't make any difference.

    Also another funny thing is couple of our devs are not experiencing this issue at all, prefabs hold references no matter what.

    Has anyone experienced this issue with Unity 2018.3.9f1+ and if so figured out what the root cause of this issue is? Any insight on this would be very helpful, thank you.
     
    Evehor likes this.
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    If there are any compile errors at the time when you update, references will not work correctly until compile errors have been fixed and the affected Prefab reimported. They should get automatically reimported once compile errors are fixed in this scenario, but if it doesn't happen, a manual reimport should fix it.