Search Issue Tracker
Duplicate
Votes
1
Found in
2020.3
2021.1
2021.1.3f1
2021.2
Issue ID
1331457
Regression
No
Script loses reference to a MonoBehaviour after adding Serialized variables to another script
How to reproduce:
1. Open the attached project "Roguecaster.zip"
2. Go to Assets > _Game > Scripts > Units > AIComponent
3. Uncomment lines 16 or 17
4. Click Play
Expected result: No exceptions are logged to the Console
Actual result: A MissingReferenceException is logged to the Console
Reproducible with: 2020.3.7f1, 2021.1.6f1, 2021.2.0a16
Could not test with: 2018.4.34f1, 2019.4.26f1 (scripts use C# 8.0)
Workaround: Reimport all assets or add [System.NonSerialized] to the mentioned variables
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
This is a duplicate of issue #1360351