How can I make a plane used for GUI not blocking mouse actions?

Hi All,

I have a GUI rectangle placed on a scene from a dynamic texture created from a plane. Everything is OK visually, but the height of the rectangle does not fit the height of the plane (on purpose of course). Problem is, all the mouse actions (hovers, clicks, etc…) are only triggered when the invisible plane is not blocking the way.

One example :

As you can see, you have to put the cursor very high before the hover on the sphere is triggered and the background of the rectangle changes. Is there a way to prevent that ?

Thanks in advance.

Goog coding.

It is because your plane is pickable: https://www.babylonjs-playground.com/#Z0H8U0#1

Thanks sebavan.

Hello !

I have the exact same problem than Glopper here but I can not accept this solution: if my plane contains input fields, it has to be pickable.

I created a playground : https://playground.babylonjs.com/#ZI9AK7#2217

You can see that something is blocking the input to be clickable : the plane that is { width : 2, height : 2 }
A solution is to scale the plane on Y axis (line 36) and put the input size to 1 to extends to maximum : it works ! But… The text inside the input is streched due to the scaling :cold_sweat:

Do you have any ideas of how I can solve this ? :slight_smile:

See you soon

cc @DarraghBurke

I am not sure I understand the issue here. I am able to click on each input and the text does not appear stretched. Can you specify what element is not clickable?

Hello,
The problems appears more when the inputs are close to each other : https://playground.babylonjs.com/#ZI9AK7#2221

In this case the middle one is clickable but not on the entire surface of the element, I managed but hardly to get the focus on… Do you have a working case on your side ? :thinking:

1 Like

Ah, I see…how about if you make the planes smaller, let the GUI controls be 100% of the width and height, and then use scaleY to fix the text scaling? Texture mode Babylon.GUI | Babylon.js Playground (babylonjs.com)

2 Likes

Yes, scaling the buttons do the trick, even with inputs very close to each other :slight_smile:
https://playground.babylonjs.com/#ZI9AK7#2223 I’m not very aware of all of the GUI possibilities, thanks again :wink:

2 Likes