# How to get the picking point with OnPickTrigger and ExecuteCodeAction?

**URL:** <https://forum.babylonjs.com/t/how-to-get-the-picking-point-with-onpicktrigger-and-executecodeaction/42734>\
**Category:** Questions\
**Tags:** pointerevents, picking, action\
**Created:** [July 26, 2023, 10:46pm UTC](https://forum.babylonjs.com/t/how-to-get-the-picking-point-with-onpicktrigger-and-executecodeaction/42734 "2023-07-26T22:46:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trusktr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/trusktr/32/840_2.png) [@trusktr](https://forum.babylonjs.com/u/trusktr)\
**Post date:** [July 26, 2023, 10:46pm UTC](https://forum.babylonjs.com/t/how-to-get-the-picking-point-with-onpicktrigger-and-executecodeaction/42734/1 "2023-07-26T22:46:44Z")

</div>

How do we get the picking point in from the ActionEvent passed to my ExecuteCodeAction triggered by OnPickTrigger?

For example:

```js
        const actionManager = new ActionManager(scene)

        actionManager.registerAction(
            new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger, (event) => {
                const pickingPoint = // ... get the picking point from the event ...
                console.log(pickingPoint)
            })
        );

        mesh.actionManager = actionManager

```

---

<div class="post-metadata">

**Author:** ![trusktr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/trusktr/32/840_2.png) [@trusktr](https://forum.babylonjs.com/u/trusktr)\
**Post date:** [July 26, 2023, 10:55pm UTC](https://forum.babylonjs.com/t/how-to-get-the-picking-point-with-onpicktrigger-and-executecodeaction/42734/2 "2023-07-26T22:55:39Z")

</div>

Ah, the `event.additionalData` has type `any`, so I didn’t realize that’s where the info was.

Solution:

```js
        const actionManager = new ActionManager(scene)

        actionManager.registerAction(
            new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger, (event) => {
                const pickingPoint = event.additionalData.pickedPoint
                console.log(pickingPoint) // yay
            })
        );

        mesh.actionManager = actionManager

```
