I am trying to create a GUI with a ScrollViewer that has TextBlock items that are clickable. I am finding the pointer click very inconsistent in this playground. Any suggestions?
https://playground.babylonjs.com/#HJZBRG#198
Adding @msDestiny14
Ah, took me a second to see the issue you’re having. Let me take a look.
So I went down to the lowest level possible to try to see if it was a bug or not. Based on a test I made it doesn’t appear to be a bug but rather a mistake somewhere in the demo (where. I’m not sure ) https://playground.babylonjs.com/#XCPP9Y#7652
One thing I did notice I was missing which led me to get the initial same result as you was not including IsPointerBlocker = true; I’m also wondering if its selecting the stack panels or something else rather than the text.
Edit: OH! wait a minute, it appears something I didn’t see was CreateFullscreenUI vs CreateForMesh. This might be a bug.
Edit 2: Sorry for all the edits, just updating as I’m debugging. Made a new test here with CreateForMesh which is also working. https://playground.babylonjs.com/#XCPP9Y#7653 so at this point it’s probably a mistake within the demo.
so what would I need to do with my demo to make the click events consistent?
Hiii, I was looking at this with @msDestiny14 for a bit, and after playing around a bit we think we have found the solution. Here is the working version with consistent clicking: http://playground.babylonjs.com/#HJZBRG#201.
So it seems like the issue was at line 43 with the /2 that was being used. After removing this /2, everything seems to work correctly!
Way to go @SahilTara !
Well done buddy!
That was it - z-fighting.
Thanks,
Michael