ActionManager: Picking Order (OnPick, OnLeftPick, OnRightPick)

Dear community,

if I register the normal pick triggers (OnPickDown, OnPick, OnPickUp), the triggers are executed in an order I would expect - OnPickDown when the mouse (or touch) is pressed, OnPick and OnPickUp when the mouse is released. However, for OnLeftPick and OnRightPick, the triggers are executed together with OnPickDown instead, so they are firing already when the mouse button is pressed. Is this working as intended or is this a bug?

A PG showing the behavior can be found here: Babylon.js Playground

Kind regards
Zacherl

They are indeed defined with the down pick on code: https://github.com/BabylonJS/Babylon.js/blob/d96704749b916f5f6ecb4fe500b92b5746f56a55/packages/dev/core/src/Inputs/scene.inputManager.ts#L383, through I can’t say why it was defined like this :sweat_smile:

1 Like

Thank you for your quick answer! At the moment, we simply use the pick trigger and check the event data to derive the mouse button, so it is not a big issue. I’d still love to know if there is some intention behind the implemented behavior.

I would bet either the person had some sort of drag & drop in mind or simply a mistake :thinking:

You can however use pointerObservables to get any behaviour you want

1 Like