Can someone help please, I’m unable to get AmmoJS to work with my project setup. I was initially using OimoJS but had to switch to AmmoJS. I have read the docs and followed the steps but still having issues. see below:
Error
TypeError: Cannot set properties of undefined (setting 'Ammo')
This is still pretty bad as you should await the promise and not only fire and forget but at least it will work.
The second solution is to rely on ammo directly and in this case from solution 1. you only change:
import Ammo from 'ammojs-typed' to import * as Ammo from 'ammo.js'; but you need to add a typings file for it in your project like in app you create a ammo.d.ts file containing:
declare module 'ammo.js';
You would basically lose ammo typings except if you manually create them in the d.ts file but will be on latest.
@sebavan Ok, I tried both methods and all worked great and as expected except that I had to remove the solution due to some new issues I was getting with Cannon and Ammo. So I’m back to using OimoJS but the good news is I found a solution to the inital issue why I had to switch physics engine
Thank you guys for all your help, really appreciate it.