unclickable while paused

Hello, Everyone!

Imagine a game like Tetris. Different figures drop, but they are destroyable by clicks. While the game is paused and pause menu appears, figures are still clickable even through buttons. Although, button behind menu is not interactable. I use Visual Scripting if it matters.

Just started to learn unity, so maybe I’m just missing something.

Thanks for reading!

Not familiar enough with Unity to say if there’s a simpler solution, but I imagine you could create a scene bool for pause, and filter every click event on the GameObjects you don’t want clicked through an if statement off of that boolean and just put nothing after the true exec pin and run the rest of your logic off of the false pin.

You can’t set the timescale to 0 to pause. You need to set it to 0.01 or something small so the game is still simulating so the buttons work. At that speed, UI will work and the game will be effectively paused.

Thank you for your answer!

Buttons are working properly. Button “pause” which is behind the pause menu doesn’t work as it should. But the objects are still clickable for some reason.

Thank you for your answer!

I thought that there is a solution through object scripts. Like: on mouse input if timescale = 0; true = “do what it should”, false = do nothing. But I guess there might be an easier solution, maybe somewhere in canvas settings or smth like that. Not so sure as well …