Picking particles in SPS bug

Examples from this documentation page (https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/picking_sps) don’t work in BabylonJS 5 in playground. It starts to work if we switch to BabylonJS 4.
Also, the links are messed up. A button that is supposed to lead to example without rotation, actually leads to example with rotation. And vice versa.

Thanks for the feedback, this PR will fix the PGs inversion in the doc:

Regarding the picking problem, let’s cc @PolygonalSun:

I could trace the problem back to this modification:

This check:

scene.onPointerObservable.hasObservers() || scene.onPointerPick || scene.onPointerDown

has been replaced by:

this._scene.onPointerObservable.observers.length > this._cameraObserverCount || this._scene.onPointerPick || this._scene.onPointerUp

in this PR:

1 Like

@PolygonalSun it looks like this might be a regression, can you have a look ?

Definitely looks like a change in behavior here Cameras: Modified cameras to work under onPointerObservable by PolygonalSun · Pull Request #13293 · BabylonJS/Babylon.js · GitHub

I’ll take a look

Just an update, I found the root cause of the issue, it looks like a recent update changed the picking logic slightly. I have a fix for it and am currently writing some tests to prevent this from happening again. I’ll update you when I have a PR live.

1 Like

PR is live: InputManager: Update logic for detecting when to pick by PolygonalSun · Pull Request #13321 · BabylonJS/Babylon.js (github.com)

2 Likes

PR is merged

1 Like