Mutually exclusive checkboxes

Hi,
I want to have a set of mutually exclusive checkboxes. Example:

Choose your race:

o Elf

o Dwarf

o Dragon

o Human

o Spirit

o …

It seems the engine doesn’t support natively something like this in the UI. Am I missing something? Will be a great addition to simplify UI creation.

What is the best way to accomplish this? Maybe an array of checkboxes?

I found a solution to the mutually exclusive pattern assuming you have a fixed amount of checkboxes you know upfront.

][1]

You create a new canvas panel which contains all your checkboxes. You flag the “is variable” on the panel and also on your checkboxes, so you can manipulate them from BP. Then you add a new variable to your UI called “Clicked Race” (in my case is a list of races) of type checkbox.

Then for each checkbox you select the “OnCheckStateChange” event.

The red nodes on the left are all the events of the checkboxes. The first thing you do is to set your “Clicked Race” variable to the corresponding check box, then you cycle on the canvas panel children, checking for each one if they are equal to your clicked one. If equal then you turn it on, if not then you turn it off. DONE!
The picture should help you to reproduce it in your project. To get the object == object expression, just type == in the pop up window when you drag the checkbox cast.

1 Like