Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Unity toggle bug?

Discussion in 'Editor & General Support' started by -JoSeM-, Apr 23, 2019.

  1. -JoSeM-

    -JoSeM-

    Joined:
    Jul 8, 2014
    Posts:
    8
    Hello.
    I updated recently my unity 2018 version to 2019. After the update I am getting some troubles with the toggles.
    My scene has a gameobject which has another gameobject with the toggle component attached. On version 2018 I could SetActive true or false the parent of the toggle and nothing changed the toggle. Now (2019 version) I am getting the OnChangedValue triggered by setting active true or false the parent of the toggle.
    Only the one of my multiple toggle list is triggered this way

    I don't know what's happening. I am even getting the following:
    Assertion failed on expression: 'go.IsActive()' UnityEngine.GameObject:Find(String)


    Thank you
     
    mkowpak, AlexisTB and monblank like this.
  2. AlexisTB

    AlexisTB

    Joined:
    Jul 26, 2017
    Posts:
    4
    I am having the same issue. Toggle.OnDisable() is making a chain reaction

    Code (CSharp):
    1.      Void UnityEngine.UI.Toggle:Set (Boolean, Boolean)+0xa5 at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Toggle.cs:274    C#
    2.      Void UnityEngine.UI.Toggle:set_isOn (Boolean)+0x4 at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Toggle.cs:237    C#
    3.      Void UnityEngine.UI.ToggleGroup:UnregisterToggle (Toggle)+0x53 at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\ToggleGroup.cs:71    C#
    4.      Void UnityEngine.UI.Toggle:SetToggleGroup (ToggleGroup, Boolean)+0x19 at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Toggle.cs:176    C#
    5.      Void UnityEngine.UI.Toggle:OnDisable ()+0x4 at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Toggle.cs:150    C#
    6.  
    Which then triggers Toggle.onValueChange (not the one that has just been disabled, but the other toggles in the group). It should be fine if you unregister before the disable.

    Unity version is 2019.1.2f1
     
    Last edited: May 17, 2019
  3. brockemon

    brockemon

    Joined:
    Dec 21, 2012
    Posts:
    24
    Yep me too. Very annoying!
     
  4. chrpetry

    chrpetry

    Joined:
    Mar 7, 2018
    Posts:
    7
    Yeah same problem here!
    When a gameObject with a ToggleGroup gets activated, underlying toggle groups fires on all toggles!
     
  5. unity_8ovt9frLBZCO-g

    unity_8ovt9frLBZCO-g

    Joined:
    May 7, 2019
    Posts:
    2
    I thought I did something wrong. Whenever I leave the scene with toggle group, all the toggles' valueOnChanged() fired one by one... Then the settings I saved all set to the last toggle in the toggle group.

    Is there any way to get rid of this?