# Action manager pointer trigger with bounding box

**URL:** <https://forum.babylonjs.com/t/action-manager-pointer-trigger-with-bounding-box/43891>\
**Category:** Questions\
**Created:** [September 6, 2023, 8:53am UTC](https://forum.babylonjs.com/t/action-manager-pointer-trigger-with-bounding-box/43891 "2023-09-06T08:53:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 6, 2023, 8:53am UTC](https://forum.babylonjs.com/t/action-manager-pointer-trigger-with-bounding-box/43891/1 "2023-09-06T08:53:27Z")

</div>

PG: [Babylon.js Playground](https://playground.babylonjs.com/#VY17FW)

Just to explain what’s going on, the PG is a hack for meshes that need bounding box-like picking with action manager. I thought that perhaps its a roundabout way to handle mesh picking since `scene.pickWithBoundingInfo` exists. I chked with src and it appears that `scene.inputManager.ts` largely uses `scene.pick` for all its needs. And the action manager triggers are wrapping around it.

I was thinking something along the lines of:

```auto
public _pickMoveWithBoundingInfo(evt: IPointerEvent): PickingInfo {
        const scene = this._scene;
        const pickResult = scene.pickWithBoundingInfo(
            this._unTranslatedPointerX,
            this._unTranslatedPointerY,
            scene.pointerMovePredicate,
            scene.pointerMoveFastCheck,
            scene.cameraToUseForPointers,
            scene.pointerMoveTrianglePredicate
        );

        this._setCursorAndPointerOverMesh(pickResult, evt, scene);

        return pickResult;
    }

```

And have `_pickMoveWithBoundingInfo` available to incorporate in the picking flow according to new triggers `ACTION_OnPointerOverBoundingInfoTrigger`/`ACTION_OnPointerOutBoundingInfoTrigger`. But it seems like that’s not how the picking flow works…

My question is: with the current architecture, there really is no clean way to incorporate `scene.pickWithBoundingInfo` and `scene.pick` in the same scene, is there ?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [September 6, 2023, 11:28am UTC](https://forum.babylonjs.com/t/action-manager-pointer-trigger-with-bounding-box/43891/2 "2023-09-06T11:28:05Z")

</div>

Hmmmmm, yeah, I’d go with the “fake” box hack instead of trying to mess with the inputManager code 😅 @PolygonalSun might have some idea about the input manager through?

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [September 18, 2023, 6:50am UTC](https://forum.babylonjs.com/t/action-manager-pointer-trigger-with-bounding-box/43891/3 "2023-09-18T06:50:59Z")

</div>

ok thks, marking as solved. Been a while since I’ve submitted a PR to inputManager but this hack doesn’t impact perf, is sufficiently clean and works for all hollowed out shapes, I guess its not a biggie. Shrugs…
