AmmoJSPlugin issue from the past 8 hours (cdn and preview)

Dears,
I woke up this morning and AmmoJS was not working anymore in any of my version scene.
I saw a discussion from yesterday regarding changes for packaging. May be one of these changes caused the issue. Can you have a look if it’s a bug or else tell me how to load the new version plugin successfully.
Thanks a lot,

Hi @mawa, could you try running

await Ammo();

in an async function before

scene.enablePhysics(...)

or you could use .then(...) like

Ammo().then(Ammo => {
    scene.enablePhysics(...)
});

For your reference, this was recently changed in Ammo: TypeError on reloading Playground (Need to click Play button to bypass error) :slight_smile:

2 Likes

I will add it to the list of breaking changes, I completely forgot to do.

@mawa, this is not really our choice, but Ammo changed its initialization and made it async so we can not rely anymore on the engine to initialize it :frowning:

Yes, thank you.
Good practice anyway, I suppose… but ya know how it is: as long as it works… :wink:

1 Like

Yes, I get it and thanks for the reply. As I said probably part of good practice.
Another good practice would be to be advised of such type of changes in architecture before updating cdn. (I suppose). On the other hand, reactivity for this kind of issues in BJS is awesome. Can’t have everything, now can you?
Have a beautiful day,