[SOLVED] Action not working unless `@babylonjs/inspector` is imported

Hi there,

I’m working with actions, and everything was working fine until I removed the inspector from my code.

I’ve set up a demo repository so that you can see it with your eyes.
If you uncomment line 14, the action on the mesh runs.

Is this a bug or I am doing things wrong?

The thing is as you rely on some hover trigger you need raycasting and picking. Also the action you use relies on animations.

You therefore need to use :
import ‘@babylonjs/core/Culling/ray’
import ‘@babylonjs/core/Animations/animatable’

Those are referenced here: ES6 - Babylon.js Documentation

You do not need this with the inspector as it is importing them already for its own use so they do en up in your bundle.

1 Like

Thanks for the clarification @sebavan, it wasn’t that obvious for me.
Now everything’s working fine :pray:

Yep totally understand, side effects are a pain !!!

And here it is even worth cause it is kind of nested dependencies…

Do not hesitate to ask.

1 Like