Search Issue Tracker
Fixed in 2019.3.X
Fixed in 2019.1.X, 2019.2.X
Votes
28
Found in
2019.1.0a5
2019.1.0f2
Issue ID
1146883
Regression
Yes
Re-enabling game object with "Toggle group" loses information about previously checked toggle
Steps to reproduce:
1. Open attached project "Test.zip"
2. Go into play mode
3. There are 3 toggles at the top, select a red one (row of red toggles should appear on the left side)
4. Check the first toggle on the left side row (You can check any toggle, but remember your choice)
5. Press green toggle (from 3 toggles at the top)
6. Press red toggle again (from 3 toggles at the top)
-The first toggle is not selected anymore from the left row, instead, another toggle is checked randomly. (Attached a video)
Explanation: Toggles at the top disable/enable "Toggle group" (only a single game object with toggle group is active at a time)
Expected result: After re-enabling element with "Toggle group" it shouldn't uncheck previously checked toggle
Actual result: Re-enabling game object with "Toggle group" loses information about previously checked toggle and instead checks random toggle in the group
Note: Sometimes it takes a couple of tries to reproduce the bug (repeat steps from 3rd step)
Reproduced on: 2019.1.0a5, 2019.1.0a6, 2019.1.0a11, 2019.1.0f2, 2019.2.0a1, 2019.2.0a10
Doesn't reproduce on: 2017.4.0f1, 2018.3.13f1, 2019.1.0a1, 2019.1.0a3, 2019.1.0a4
Regressed in: 2019.1.0a5
-
drorriov
Jun 26, 2019 05:32
Please fix with current 2019.1.x, I don't want to workaround by replacing buttons with the toggles as it removes its purpose.
-
KaOzz
Jun 26, 2019 03:49
Please, fix this on stable versions!
-
MikeHergaarden
Jun 19, 2019 08:34
Unity is taking too long on fixing issues like this one that are breaking upgrades.
I know bugs are inevitable, but Unitys reaction to then always marking critical issues as "fixed" in futuristic alpha version is pissing me off.Please just be honest about it still being an issue in the actual production version. You cannot expect us to deploy on alphas or betas.
-
Gloryiam
Jun 11, 2019 12:23
I really don't get it either. Maybe there is a good reason why it's not included yet but I don't get it. I made a post on the forums about it so maybe others replying there might get this fix pushed up to an earlier version.
-
KospY
Jun 11, 2019 12:05
For the love of the god, please Unity, stop saying that a bug is fixed when it's not.
The current production version of Unity is 2019.1, not 2019.3 ALPHA.Moving to an alpha version of Unity is not a fix. Alpha and beta are not stable, it bring new bugs that will be resolved in further alpha or beta version. It's an endless cycle and we can't stabilize anything with this method.
-
Maulwurfmann
Jun 10, 2019 16:06
Just tested it with 2019.1.6, it is still not fixed, but it seems to works a bit better, at least for me, it takes a bit longer to break...
-
rushk1
Jun 08, 2019 07:48
@DREAMKNIGHT
You're right, thanks for pointing this out -
DreamKnight
Jun 08, 2019 04:46
@RUSHK1 I seem that it is "Known issue" not "Fixed" in 2019.3.0a5....sorry.
Release note Link : https://unity3d.com/kr/unity/alpha/2019.3.0a5
-
rushk1
Jun 07, 2019 03:34
@GLORYIAM
Thanks ! Checked the release notes and according to them it's fixed in 2019.3.0a5 -
Gloryiam
Jun 06, 2019 13:11
@RUSHK1 It shows as fixed in 2019.3. Many people are not happy with having to wait that long though for this to be resolved. Not sure what else we, the users, can do to make this happen faster besides posting here and on the forums.
I guess we can go back to a previous version but that's not the best solution. Also, someone earlier posted a script with a temporary fix - thanks for that :-)...though I haven't tried it yet to see if it works.
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
- Rendering locks up when not looking at a transparent material on Meta Quest 2
- Volumetrics break when using a Custom Pass to create a Thickness Buffer for Alpha Clipping
- All tests are run instead of only the failed ones when the "Rerun Failed" button is pressed
- GameObject is not masked when the "Render PostProcessing Effects" pass executes with a resolved non-MSAA Color target and MSAA DepthStencil target
- [Android] Gfx.WaitForGfxCommandsFromMainThread high performance usage and inconsistency when built Player scene has Canvas GameObject on a specific Project
Resolution Note (fix version 2019.3):
By default, ToggleGroup is coded to activate/deactivate the container for all associated Toggle elements. When the container is deactivated, all contained Toggles will get their OnDisable called. This will cause the Toggle to unregister itself from the ToggleGroup.
When a Toggle calls UnregisterToggle() on it's ToggleGroup, it is removed from the ToggleGroup's internal list.
Previously, any time UnregisterToggle() was called on a ToggleGroup that is set to disallow an off state, the group will then scan its list for at least one checked Toggle. Because the checked toggle is ultimately removed from the list before the list is totally emptied, the group will attempt to fix itself and set the first Toggle in the list to be On. This creates unpredictable behavior, both because the order of the list is non-deterministic, and because the first list element is rarely the value that should be set to On.
This PR moves the logic for ensuring that one Toggle is marked On to a new function. The only times that this function actually needs to be invoked are:
a) when the ToggleGroup gets its Start() method invoked. This will ensure that a ToggleGroup created in the Editor has a valid state when loaded.
b) when a Toggle is deleted from the ToggleGroup. If the checked toggle is deleted programmatically or via the scene hierarchy, the list must choose a new one.
New Toggles that are added programmatically will fix the state of the ToggleGroup as happened previously.