Search Issue Tracker
Fixed in 2021.2.X
Votes
1
Found in
2018.4
2019.4
2019.4.15f1
2020.2
2020.3
2021.1
2021.2
Issue ID
1319708
Regression
No
ArgumentNullException gets thrown when changing the base class to MonoBehaviour of a Script that is attached to a State
How to reproduce:
1. Open the attached '1319708.zip' project
2. In the Project window double-click on the Test Animator Controller
3. In the Animator window select the 'A' State
4. Observe the Inspector
5. Open Assets > DummyScript.cs
6. Change the base from 'StateMachineBehaviour' to 'MonoBehaviour'
7. Save the Script
8. Switch back to the Unity Editor
9. Select the 'A' State
10. Observe the Inspector
Expected result: The 'Add Behaviour' button is displayed in the Inspector, no visible errors present
Actual result: The 'Add Behaviour' button and the 'DummyScript' component are not displayed in the Inspector, multiple ArgumentNullException errors appear in the Console
Reproducible with: 2018.4.32f1, 2019.4.22f1, 2020.2.7f1, 2020.3.0f1, 2021.1.0b11, 2021.2.0a8
Notes:
- The following error gets thrown in the Console:
ArgumentNullException: Value cannot be null.
Parameter name: componentOrGameObject
- The issue doesn't reproduce when changing the base class to 'ScriptableObject'
Comments (3)
-
dpr-010
Mar 25, 2023 17:35
I had a similar issue and basically resolved by restarting the editor.
-
Matt_Raph
Mar 31, 2021 12:56
Also note: you can still interact with the state, you just can't see it
-
Matt_Raph
Mar 17, 2021 11:21
It feels so good to contribute something.
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
- GfxDevice::UpdateBufferRanges when running UIBuilder tests
- [Android][BiRP] Depth processing is handled incorrectly on certain Android devices when using 2 camera's
- [APV] Cancelling Display Dialog Error is thrown after Adaptive Probe Volumes tab is open in Lighting Window
- [APV] NullReferenceException is thrown when baking Adaptive Probe Volume for a Terrain with Non-GI Contributing Tree Prototypes and multiple APV objects with different LayerMasks are present on the scene
- Hands are not recognized when using Hololens 2
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a15