Search Issue Tracker
Fixed in 2021.2.X
Votes
0
Found in
2019.2.0b4
2020.2
2020.2.1f1
2021.1
2021.2
Issue ID
1307257
Regression
Yes
InvalidOperationException is thrown when Toggle component is toggled in Inspector window, using "Is On" field
Reproduction steps:
1. Open user's project "ToggleEditorExceptionInPlaymode.zip"
2. Open "SampleScene" Scene
3. Enter Play Mode and click on "Toggle" under "Canvas" in the Hierarchy window
4. Try toggling the Toggle in Game View while looking at the Inspector window
5. Notice how the "Is On" field in Inspector is toggled as well
6. Try toggling the "Is On" field in Inspector
Expected result: Toggle in Game View is toggled when toggling the "Is On" field in the Inspector
Actual result: "InvalidOperationException: This cannot be used during play mode." exception is thrown when toggling the "Is On" field in the Inspector
Reproducible with: (using UGUI 1.0.0) 2019.2.0b4, 2019.4.0f1, 2019.4.19f1, 2020.2.3f1, 2021.1.0b4, 2021.2.0a3
Not reproducible with: (using UGUI 1.0.0) 2018.4.31f1, 2019.2.0b3
Note: on version 2018.4.31f1 toggling the "Is On" field in the Inspector doesn't toggle the Toggle in the Game View
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a8