moveWithCollisions together with gltf-imported meshes does not work correctly

Hi there, im developping a medieval 3rd person online game.
I use blender to create most of the graphical assets (also animated characters)

Try it yourself:
https://to5ta.github.io/js_zero/

As i didnt want to initialize a whole physics engine only for the character controls, i started using moveWithCollision to move my character in the desired direction instead.

This approach works fine for meshes i created with the MeshBuilder (CreateBox/CreatePlane), but is rather buggy for imported gltf-meshes.

Notice how you can sink in the greater box or even walk through its walls. Whereas the small box works fine for me currently.

So, how to fix moveWithCollisions used together with gltf imported meshes?

Any help is highly appreciated :slight_smile:

Pinging @Cedric (but please be patient as Cedric is on vacations)

1 Like

anyone knows if this is a known issue? worth a bugticket somewhere?

My next step would be now to export the physics geometry mesh to a text file, parse in js and build up the physics geo from arrays (i think thats possible?)

It should work if you iterate on all meshes from the .gltf once it’s loaded and set checkCollisions = true; for each one.

If it doesn’t please provide a PG so I can help you debug it.

think i did that before but thanks for the reply! :slight_smile: I gonna check your suggestion and will either come up with the workaround or provide a playground.
Currently i work on sound / music for my game, no issues in sight :smiley:

2 Likes

Just wanted to let you know that the issue seems to be fixed now. gltf-collsion box are treated equally as a box from the mesh generator regarding the collision detection! Big thanks to anyone who fixed it!

3 Likes