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

Bug Some references in the inspector are reset after checkout in git

Discussion in 'Editor & General Support' started by ByMedion, Nov 3, 2021.

  1. ByMedion

    ByMedion

    Joined:
    May 10, 2018
    Posts:
    19
    Hi! This is actually a pretty old issue going from version to version. If you have a scene open in the editor with some script, and then switch to another branch in the git, where the script fields were added or changed, then they will become null (None) after the scene is automatically reloaded. Unloading and loading a scene manually fixes references in inspector, but you have to do it yourself every time.

    Version 2020.3.20 is currently used, but the bug was encountered on absolutely all other versions that I used
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    Doesn't really seem like a bug. You're modifying the scene out from under Unity. Not sure how it's supposed to reasonably reconcile that.
     
  3. ByMedion

    ByMedion

    Joined:
    May 10, 2018
    Posts:
    19
    I'm sure this is a bug. After all, the automatic scene reloading when its file changed does not work correctly. Manual unload/load works as expected: references are deserialized and set in the inspector