Search Issue Tracker

Won't Fix

Votes

1

Found in

2019.4

2019.4.2f1

2020.2

Issue ID

1278731

Regression

No

Object references are not loaded after you git checkout to another branch

Scene Management

-

How to reproduce:
1. Extract attached "git.zip"
2. In the newly created folder run these commands: "git reset --hard" and "git checkout a"
3. Open scene "SampleScene" in the appeared unity project
4. Select object: "Scene object"
5. Run the command: "git checkout b"
6. See: "Sample" script on GameObject "Scene object" has 2 fields (Component and Go)

Expected Behavior: These 2 fields have references attached to them
Actual Behavior: They are both nulls

Reproducible with: 2019.4.11f1, 2020.1.6f1, 2020.2.0b3

Could not test with: 2018.4 due to script compilation errors

Note: If you reload the scene - these fields regain references

  1. Resolution Note (2020.2.X):

    When the scene is loaded any redundant data stored in the scene for valid monobehaviours is discarded. It might be that the script is changed and the redundant data could suddenly be applied but the only to robustly do this would be to ask the user to reload the scene, potentially having to discard unsaved changes. It would also suddenly mean that any script changes would ask the user to reload the scene which would be a problem when iterating on a script.

Comments (1)

  1. nijatali1122

    Sep 19, 2020 13:48

    this is what i was looking for!! finally i got it!!!thanks for sharing!!!

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.