PickedMesh is null in onPointerObservable

Hello.
After upgrading to version 5.17.0, a problem appeared. With the BABYLON.PointerEventTypes.POINTERDOWN event, pickedMesh is always null. The problem has appeared only since version 5.17.0. Please tell me in which direction to look for a solution. The code is deeply integrated into the project, it’s hard for me to reproduce this.

It looks something like this:

scene.onPointerObservable.add((pointerInfo) => {
	if (pointerInfo.type === BABYLON.PointerEventTypes.POINTERDOWN) {

		// always null
		console.log(pointerInfo.pickInfo.pickedMesh);		

	}
});

If you go back to version 5.16.0, this code works fine.

CC @PolygonalSun

Is it reproducible in the playground? or only in your project?

Unfortunately only I have.

Unfortunate but solvable, I am sure :slight_smile:

Can you share a reproduction?

1 Like

Just out of curiosity, do you have a custom predicate for scene.pointerDownPredicate?

Hi.
Thanks for the answers. I want to clarify. This happens when installing multiple cameras. Roughly, it looks something like this: https://playground.babylonjs.com/#R5UWI5#2

It seems that it turned out to solve the problem with cameraToUseForPointers.

3 Likes