I think there is a pretty easy solution available.
- Place the modal window or whatever frame you want to use for your popup message under an empty game object - let's call it errorGameObject.
- Ensure that your modal window is always active.
- Also, add an empty image (call it overlayImage) that spans the whole scene height and width-wise.
- Then change the image's Alpha (A) property (in color) to 1. This image is now acting as an overlay and on top of that sits your window that you want to be modal.
- Now, in the button click, make the errorGameObject.setActive(true).
So, in hierarchy window, it should look like this:
With this approach, when the errorGameObject is setActive - none of the other input controls, even though visible, could be interacted with, because of the ultra-thin overlay image guarding them.