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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Exported prefab always has missing script, even when "export with dependencies" is checked

Discussion in 'Editor & General Support' started by MaxLohMusic, Jun 5, 2023.

  1. MaxLohMusic

    MaxLohMusic

    Joined:
    Jan 17, 2022
    Posts:
    45
    I can't export a prefab while keeping all its scripts and script variables, which is important because it would take a while to manually reassign them.

    Even if I check "export with dependencies", and select that prefab to export, it exports only that prefab, with no dependencies. When I import it, all the scripts are missing.

    I tried a workaround to export with dependencies but it just exported almost the entire project. Even when trying to import this exported-whole-project into my new project, selecting that prefab, and even selecting the script that should've been included with it, the prefab will always show that script as "missing".
     
  2. MaxLohMusic

    MaxLohMusic

    Joined:
    Jan 17, 2022
    Posts:
    45
    I finally figured it out. "Export with dependencies" never does anything when exporting a prefab. It behaves the same as if it were unchecked. Even if the prefab uses other prefabs/scripts, it will always be exported alone as a single file. Not sure what the actual use case is for it...

    To actually achieve "Export with dependencies" behavior, one must MANUALLY tick the checkboxes of all the prefab/script dependencies and export them in the same package. Only then, will they be populated correctly when importing into a new Unity Project.
     
  3. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    10,049
    Great, please put this in a bug report.