Can not make characterController work on my project

Hello guys , sorry but I still need some help getting the character controller module
working.

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 !!!

Hello!

EDIT: it is fully working now!
Here is the PR in case you want to merge it. Character controller by RolandCsibrei · Pull Request #1 · leostereo/solidPath · GitHub Or you can close the PR.

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.

Try to remove all errors, like:


You were using @babylonjs/core and babylonjs as well. babylonjs removed.

1 Like

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.

Always choose glb if you can.

It’s already in your project:

You are welcome!

1 Like

thanks my friend.
I will continue studing bbjs.

1 Like

May the Force be with you!