Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Multiple Toggle Groups Not Working

Discussion in 'UGUI & TextMesh Pro' started by chuakc92, Dec 28, 2019.

  1. chuakc92

    chuakc92

    Joined:
    Nov 22, 2016
    Posts:
    15
    I'm trying to get something like this working:
    Code (CSharp):
    1. ---Some Category---
    2. [x] Some Category Option 1
    3. [ ] Some Category Option 2
    4.  
    5. ---Some Other Category---
    6. [ ] Some Other Category Option 1
    7. [x] Some Other Category Option 2
    Where the options look like buttons/selections and the selected ones stay "highlighted". I've tried using buttons, but there's no way of changing the state of the button to the highlighted state except referencing the button's image and changing it to the state's highlighted sprite. But this messes up the sprite swap after. I've tried using Toggles, but even using multiple Toggle Groups, you can only select one toggle at a time. Even the ones from other toggle groups get deselected. Is there really no way of doing this?

    Documentation says you can have more than one, but why is it not working then?
    Toggle Groups are useful anywhere the user must make a choice from a mutually exclusive set of options. Common examples include selecting player character types, speed settings (slow, medium, fast, etc), preset colors and days of the week. You can have more than one Toggle Group object in the scene
    at a time, so you can create several separate groups if necessary.



    panel
    - toggle group
    - toggle 1
    - toggle 2
    panel
    - toggle group
    - toggle 1
    - toggle 2
     
  2. miik2

    miik2

    Joined:
    Aug 23, 2018
    Posts:
    5
    Same problem here, do you find any solution?
     
  3. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    729
    did you assign the correct toggle groups to the toggles?
     
unityunity