I started from this template since I would like to add some physics in the future.
So I wrote my scene class but can not make it work.
You will see I created 2 loadPlayer functions (using the ImportMesh and ImportMeshAsync methdos) but both returns the:
Cannot move this mesh. The root node of the mesh provided is not a mesh
Here you can find my repo .In case you want to try, just clone and checkout to character_controller branch.
Thanks !!!
Old stuff:
I changed the character controller and added it as *.ts file. No npm lib. This way it’s easy to tweak the character controller itself.
Now it attached the mesh to the character controller (no error in the console) but I had to comment out cc.start() because I believe you have misconfigured something on the character controller because the mesh disappears if cc.start() is called.
Great !!! Thanks for your help !!!
It arises some questions.
Why it uses “vincent.babylon” as character ?
Why it does not work with any .glb model ?
Are those .babylon better than .glb models ?
How should I get the raw version of CharacterController class to include in my project ?
thanks!!
Because I wanted to use the model which was used in their example to avoid any potential errors by doing something else as did they in the example.
You can try to load the glb. You should always prefer glb. I’m using a new version of the CharacterController and I completely rewrote your code so there is a quite big chance it will work with the glb.
The babylon file format is a JSON file. It’s advantage is that you can easily modify it or create it from scratch.