GUI - modal and how to block scene

in my scene some times i pop up some modal to let the user confirm an action. I want this message to be a blocker for all the scene, the user must return to the scene only if he confirm the message.
What’s the best practice to do that? I’ve tried to stop the render loop, but some mouse events are still active. Is there a way to completely freeze the scene and then unfreeze?


Hey @Mercurio - I don’t know of a way to stop or pause the whole scene. It doesn’t mean you can’t, but I’m not aware of a way. perhaps @Evgeni_Popov might know?

You can absolutely pause individual elements of a scene such as animations, physics, particles and what not. Perhaps pausing the individual elements is an option?

Not calling scene.render() is a first step indeed.

Maybe you will also need to detach controls from the active camera.

I don’t know if you need to do something else, I’m not the most knowledgeable on input controls.

Will blocking input to the underlying scene be enough? you can create a UI based on a mesh that is attached to the camera. Pointer events will not pass through it.
A very simple approach (that should be improved, of course :slight_smile: ) - PGDemo | Babylon.js Playground


Yes, maybe this is the simplest way to do that. I’ll try thanks😉