Make button to make other button visible and invisible

Hi Everyone,

I’m at the moment busy with creating a GUI for my environment. I want to make a button visible and invisible by clicking on another button. I can’t find any information about this specific. Can somebody help me?

Hi and welcome,

I think creating a playground could be a nice way to help us… helping you :slight_smile:

But basically you probably just have to play with the isVisible property I think? Button | Babylon.js Documentation

I’m creating my babylon in visual studio code. But i’ve putted now in playground. I tried isVisible property but it doesn’t work.

In specific: the button “CheckWandstatus” must become visible if I’ve pushed ButOpenWindow once and dissapeared when I pushed again.

https://www.babylonjs-playground.com/#T9Z8NL

By creating a playground I was implying that you should create a tiny scene so we can focus on your issue. Here : just create 2 buttons (the one which control the visibility of the other) in the same way you’re doing in your main application, and that’s all :slight_smile:

I made it small. The tools button must let the “wanden” button dissapear and appear

https://playground.babylonjs.com/#4U5EKB

first, you do not have any code attached to your buttons, so I guess it could explain why it does not work :slight_smile:

So you need to listen for a click and as @Vinc3r mentionned rely on the visibility to toggle. https://playground.babylonjs.com/#4U5EKB#3