How do you get a button to open a panel?

I’m currently making an idle clicking game and was curious if there was a way to make a button open a panel with upgrades on it, then, when another button is pressed, close the original panel, and open a different one.

For example,
Press button A, open panel A
Press button B, close panel A, open panel B.

I have absolutely know idea how to even start on this, so any help would be greatly appreciated.

@abc123weee Hello there.

OK, you already have the solution to your question, as you mentioned, you need to make some functions to make literally what you just said, basically you need a counter to know which panel it’s open (if you are mange all the panels inside a single component) and a function to make the current panel hides before the new selection is active.

Even you can create a component that makes the hide/un-hide automatically when you click/touch over a button, it’s some kind of trick, because you need to set a bool variable to store its status, so this way you can switch between those panels.