OnPickTrigger not working?

I’m not sure why, but my implementation of a OnPickTrigger for an object is not currently working.

The code for registering the action is found here.

My index.html is found here.

I thought it should be simple enough but apparently it’s not? Any help would be appreciated.

Hello and welcome :slight_smile:

It should indeed be simple, could you create a repro in the playground so it is easier for us to have a look ?

In the mean time I ll look into your code to see if there is anything obvious.

I am not seeing what is wrong at a first sight, so I tried in the playground and everything look ok there Babylon.js Playground

It might be related to how the mesh is created, this would be nice to have it as a repro there so I could investigate further.

I can’t reproduce this on the playground. My attempt at reproducing this with a polygon extrusion is here. However, it doesn’t have the bug.

I’m not sure if its the version of babylonjs that I used in webpack that’s causing the issue.

You could try our latest from yesterday ?

It is currently using the latest version.

so it obviously come from somewhere else but really hard to tell without repro :frowning:

I tried your project locally but I have not idea how to use and have plenty of 404 due to the missing local server.

Ok, so I changed WebPack so that it pulls Babylon externally instead (from https://preview.babylonjs.com/babylon.js). I also added a debug mode where if you type in debug in the server address field it will only bring up the renderer and not try to connect to the local server. In the bottom left is a sphere with a basic action manager and same action trigger code as the playground that you provided (specifically here).

The action still does not work. Do I need to include any other libraries to make it work?

it is because you are picking the environment and not the sphere.

If you place the camera in the skybox then you can pick the sphere:

You could simply make the environment not pickable:

helper!.skybox!.isPickable = false;
helper!.ground!.isPickable = false;
1 Like

Wow, so that was the problem. Thank you so much!

1 Like