I can't make ".then()" work with Typescript

Hello all,

I’m trying to implement an actionManager.registerAction with .then() and I’m unable to do so.
This example that works perfectly fine in the playground: Use Actions - Babylon.js Documentation (chain actions)

does not want to work when I implement it in my code (just changing what the then() does):

this._my_geom.actionManager = new BABYLON.ActionManager(this._screen_frame.getScene);

        this._my_geom.actionManager
            .registerAction(
                new BABYLON.InterpolateValueAction(
                    BABYLON.ActionManager.OnPickTrigger,
                    this._screen_frame._light,
                    'diffuse',
                    BABYLON.Color3.Black(),
                    1000
                )
            )
            .then(
                new BABYLON.InterpolateValueAction(
                    BABYLON.ActionManager.OnPickTrigger,
                    this._screen_frame._light,
                    'diffuse',
                    BABYLON.Color3.White(),
                    1000
                    )
                );

I’m getting a warning in .then( stating:
image

Do I have to specifically define the action with a different type to be able to make it work?

Thank you.

Additional information:
_my_geom type is BABYLON.Mesh

Definitely a bug…Will be fixed in next nightly

Thank you for your answer @Deltakosh ! Should I add it as an issue the the github page? (Issues · BabylonJS/Babylon.js · GitHub)

No need (already fixed and published :))

I’m still hitting this issue with 4.0.3, is there another release with this fix? Thanks!

Yep it is in 4.1 beta

Is there a timeframe for when version 4.1 will be released?

image001.jpg

You can already use it, but it is in beta version. Knowing that even if it is in beta, given the rigor of the development of Babylon, you can use it without major problem. Otherwise bugs are corrected very quickly once reported.

1 Like