# ES6 Tree Shaking Side Effect for ActionManager

**URL:** <https://forum.babylonjs.com/t/es6-tree-shaking-side-effect-for-actionmanager/35243>\
**Category:** Questions\
**Created:** [October 29, 2022, 3:16pm UTC](https://forum.babylonjs.com/t/es6-tree-shaking-side-effect-for-actionmanager/35243 "2022-10-29T15:16:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![axeljaeger](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/axeljaeger/32/21445_2.png) [@axeljaeger](https://forum.babylonjs.com/u/axeljaeger)\
**Post date:** [October 29, 2022, 3:16pm UTC](https://forum.babylonjs.com/t/es6-tree-shaking-side-effect-for-actionmanager/35243/1 "2022-10-29T15:16:59Z")

</div>

Hello together,  
I am struggling to use ActionManager/ExecuteCode action in an application that makes use of tree shaking. When I import the ActionManager/Execute-Code action like this, everything works:

```auto
import { ExecuteCodeAction } from '@babylonjs/core';

```

As soon as I rework all my imports like this:

```auto
import { ExecuteCodeAction } from '@babylonjs/core/Actions/directActions';

```

the ActionManager is no longer working, although no error messages are thrown.

I guess I miss some side effect import that I was so far unable to find. Does anyone know which side effect import I am missing?

Best regards,  
Axel

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [October 29, 2022, 4:01pm UTC](https://forum.babylonjs.com/t/es6-tree-shaking-side-effect-for-actionmanager/35243/2 "2022-10-29T16:01:58Z")

</div>

For example:

```auto
import { ActionManager } from '@babylonjs/core/Actions/'
import { ExecuteCodeAction } from '@babylonjs/core/Actions/directActions'
import { InterpolateValueAction } from '@babylonjs/core/Actions/interpolateValueAction'

```

Usage example (for your application you may need another action than InterpolateValueAction, in import as well)

```auto
        sphere.actionManager = new ActionManager(this._scene)

        sphere.actionManager.registerAction(
            new InterpolateValueAction(
                ActionManager.OnPickTrigger,
                sphere.material,
                'emissiveColor',
                Color3.Green(),
                3000
            )
        )

```

---

<div class="post-metadata">

**Author:** ![axeljaeger](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/axeljaeger/32/21445_2.png) [@axeljaeger](https://forum.babylonjs.com/u/axeljaeger)\
**Post date:** [October 29, 2022, 10:19pm UTC](https://forum.babylonjs.com/t/es6-tree-shaking-side-effect-for-actionmanager/35243/3 "2022-10-29T22:19:53Z")

</div>

Hi,  
thanks for your answer. In the meantime, I found a solution: In order to enable picking with ES6 tree shaking, you have to import this side effect:

```auto
import '@babylonjs/core/Culling/ray';

```
