However, it has a dependency âbabylonjsâ and my project is with React, I use import { ... } from "@babylonjs/core"
I tried to import âbabylonjsâ as well, even if having both dependencies is not a good option, but I end up with some type issues, and I think this library was not made to be used with these es6 modulesâŚ
Is it a workaround to get all this working ?
Thank you in advance !!
I tried solution 1, but now I encounter another problem. I am using React with Remix.run, which is a full stack web framework, and it needs to load BabylonJS on the client only.
I lazy-load it with
const CharacterController = React.lazy(() =>
import(âbabylonjs-charactercontrollerâ).then((module) => ({ default: module.CharacterController }))
); but get another error : âTarget signature provides too few argumentsâ
Regarding solution 2, I do not really know how to apply it.
Thanks for your help anyway
Both solutions work for even with React (but without React.lazy), but, of course, it also depends on environment settings.
Regarding the solution 2 is goes as something like
import * as CC from "https://raw.githubusercontent.com/ssatguru/BabylonJS-CharacterController/master/dist/CharacterController.js"
I donât know much about Remix.run but I think the solution 1 is more flexible since you may want to edit CharacterController.ts file later, so I hope youâll be able to make it work. Actually one imports it with the same way as babylon.js.
FYI⌠My Babylon Toolkit has built - in support for new Havok Physics engine with all the Unity Colliders⌠Including the UNITY.CharacterController Pro Class.