Hi everyone! I’m trying to import Havok into my project, but sadly I’m getting the following errors:
I’ve been looking at different forum posts here, but I can’t find a fix for this problem. I tried to replicate the implementation exposed here . This is how it looks:
Am I missing something here? Thanks!
1 Like
neu5
March 1, 2024, 8:47pm
2
Hey,
Could you share the repository?
It would be easier to check the project itself
emk
March 2, 2024, 3:50am
4
Babylon expects to find HavokPhysics.wasm
in the same folder as HavokPhysics.js
.
Vite will correctly copy it when building, but not while in dev mode.
You can see what Vite is building and serving in dev mode under ../node_modules/.vite/deps/
.
You can configure Vite to serve Havok
from its original location.
You might need to adjust the allowed path based on your configuration.
Add this to your vite.config.ts
:
server: {
fs: {
// Allow serving files outside of the root
allow: [
"../.."
]
}
},
optimizeDeps: { exclude: ["@babylonjs/havok"] },
5 Likes
It works. Thanks a lot. For the record, I made some changes to my CreateNewScene method and It’s working perfectly. Now I need to learn the rest.