Search Issue Tracker

Fixed in 2021.1.X

Fixed in 2019.4.X, 2020.2.X, 2020.3.X



Found in


Issue ID




Prefabs are reimporting every time a code change is made

Asset - Database


Based on the discussion on this forum thread:

I was discovered that when the following conditions aligned, all Prefabs with a [SerializeField] attribute in a Script were reimporting:
1. Create a project
2. Create a Prefab (PrefabA)
3. Create a new Monobehaviour (i.e. ScriptA.cs)
4. Create another Monobehaviour (i.e. ScriptB.cs)
5. Add ScriptA & ScriptB to a prefab.
6. In Script A, add a private variable:
[SerializeField] private ScriptB scriptReference;
7. Add a new Script that contains this (AssemblyStaticInfo.cs):

using System;
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("AssemblyTitle")]
[assembly: AssemblyDescription("AssemblyDescription")]
[assembly: AssemblyCopyright("AssemblyCopyright")]
[assembly: AssemblyCompany("AssemblyCompany")]

[assembly: CLSCompliant(false)]
[assembly: ComVisible(false)]

[assembly: AssemblyVersion("0.0.*")]

8. Create a new script (UnrelatedScript.cs)
9. Modify that script, and notice that EVERYTIME UnrelatedScript is modified, PrefabA is reimported.
10. Remove the [SerializeField] from ScriptA
11. Notice the Prefab no longer reimports.

Expected: Unrelated code changes should not reimport prefabs.

  1. Response avatar

    Resolution Note (fix version 2021.1):

    Fixed on:

    Backported to:

  2. Response avatar

    Resolution Note (fix version 2020.3):

    Fixed in 2020.2.4f1

Comments (5)

  1. 316e0c68876525db819092b26deb5349?d=mm


    Nov 11, 2021 07:26

    Same issue in 2020.3.19f1 LTS.

  2. D521d4bab9e5fca89acfb64754df554f?d=mm


    Sep 07, 2021 10:16

    Still seeing this issue in 2020.3.16f1, I get a reimport of most of the assets in our projects (resulting in a 20-30 minutes re-import) after changing a couple lines of code.

  3. 268e488556c0e9e604ef13d23f63ce62?d=mm


    Jul 02, 2021 13:44

    It's odd that this is not yet fixed in the latest LTS (Unity 2020.3.13)

  4. D6e551854c98c2086e4a6cf3689e8c6b?d=mm


    Jul 01, 2021 22:37

    If it is not fixed on the latest LTS (2020.3.x) you should not mark it as fixed. It is misleading.

  5. C03c09050f1b8e9c5e64d16823bbadd2?d=mm


    Jun 03, 2021 11:54

    Hello, can Unity 2020.3.12f1 fix this bug?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.