Open And Close a ui menu

is there a way that i can click on a button and it opens a menu and then click on that button again to close it?

Here’s an example https://playcanvas.com/project/813471/overview/vram-leak-test

Here’s the code https://playcanvas.com/editor/code/813471?tabs=51872865

Check out line 191. It toggles the menu entity “enabled” property when the menu button is clicked

        this.sceneSwitcherMenuEntity.enabled = !this.sceneSwitcherMenuEntity.enabled;
2 Likes

Thank you