Detect click to plan with texture

hello ,

i add new plane to my ground with texture but i’m with diffucult do detect the click :
const plane = BABYLON.Mesh.CreatePlane(“text”, 50, scene);
const rectangle = new GUI.Rectangle();
const text = new GUI.TextBlock();
return plane;

this is my plane and i use this methode to detect the click :

case BABYLON.PointerEventTypes.POINTERDOWN:

      if (pointerInfo.pickInfo.pickedMesh && pointerInfo.pickInfo.pickedMesh !== this.ground) {

any help ?

Hi @Viche

pickInfo.pickedMesh is the picked mesh.
See this PG:

Hope this helps :slight_smile:

1 Like

thanks for your time
in my project i add a rectangle with texture to my plan and i want to check the pick on this texture ?
how i can do that ?

Like getting the texel you just clicked?

sorry don’t understand you :confused: i have texture in my plan and i want to chech to click on it :confused:

In the picking info, you can get the texture coordinates (see bu/bv):

Then, with the UV, you can compute the texel coordinates and read back the texture pixel using readPixels