Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Got NullReferenceException when access a nested prefab right after scene loaded from AssetBundle

Discussion in 'Prefabs' started by kactus223, May 14, 2019.

  1. kactus223

    kactus223

    Joined:
    May 20, 2014
    Posts:
    35
    I have a scene A with prefab B, and prefab C is nested inside prefab B, but it is disabled. I build scene A to an assetbundle. Of course, prefab B and C will be automatically pulled into that bundle. Right after the asynchronous loading of the scene from that assetbundle finished, if I access to prefab C inside prefab B (prefab B's Start or Awake event, for instance), I'll get a NullReferenceException. Not sure if this is a bug or I've done something incorrectly. Please correct me if I'm wrong.
     
  2. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    639
    Can you please file a bug report with a small project that reproduces the issue?
     
  3. kactus223

    kactus223

    Joined:
    May 20, 2014
    Posts:
    35
    I deleted library folder to reimport everything and the error has gone.