Alternative to MANY If/Branch statements?

Yep, if your buttons are “ordered” as in, you have them indexed as button 0 to however many buttons you have, you could do something like this:

The bools on the left come from whatever way you are getting their clicked status, there will only ever be one clicked at any time, so finding the index of the one true bool will give you the index of the button that was clicked, you can then use a Switch On Int node, or pass that int as an argument into a function.

3 Likes