I’ve been tackling with this issue for days, and can’t figure out what I did wrong.
BJS version: Babylon.js v5.0.0-alpha.19
So I have a html page and have implemented a babylon scene with createScene inside the script.
I have also wrote a modal under HTML DOM structure. When a mesh with a specific name is clicked, the modal should open up, and then user can click on a close button to close it.
I detect the click with scene.onPointerObservable to detect POINTERPICK event. And when a mesh is clicked, I set the CSS style.display of the modal from “none” to “flex” so the modal will display.
Sometimes it works ok and everything is normal, but sometimes when I open the modal, I cannot close it by clicking the close button on the modal. It seems to be stuck there for a few seconds, and then the modal will close. If I click again on the mesh to open the modal, the same thing happens again.
Here is a screenshot of the web inspector from iphone safari with the latest OS (14.4.2). As you can see, the main thread is blocked for a few seconds and CPU usage is high.
If there’s any workaround for this or if there’s any misunderstanding from my side, please let me know! Thank you!
Note: on PC, everything works as expected.
p.s.: Thanks for making Babylon.js possible, as a Unity dev who is new to all this, I have lots of fun learning it and see huge potential ahead!