Falling slowly through custom model meshes

Hello I am currently implementing first person movement like in https://playground.babylonjs.com/#4HUQQ#1713 in svelte-babylon.

I uploaded an example of the current state to First person movement | Svelte Babylon

The thing is I am slowly falling through the custom mesh, but on eg the. Ground it works as expected.

I am setting all of the models meshes’ checkCollisions property to true. The rest is configured exactly as with the simple ground plane.

The main code can be seen here: svelte-babylon/FirstPerson.story.svelte at first-person-example · Myrmod/svelte-babylon · GitHub

The checkCollisions properties of the models meshes are being set at svelte-babylon/index.svelte at first-person-example · Myrmod/svelte-babylon · GitHub

I took the model from Babylon_101/public/models at 10_First_Person_Controller · Babylon-Projects/Babylon_101 · GitHub and followed the tutorial 10. First Person Controller in BabylonJS - YouTube

What could cause this slow falling through on custom elements?

Adding the following code snipped tells me, that collision is really being picked up. However it just slows down the fall.

// inside https://github.com/Myrmod/svelte-babylon/blob/first-person-example/src/examples/FirstPerson.story.svelte#L20
camera.onCollide = e => {

Hi! If you reproduce what you did on the Playground with the same custom mesh, do the collisions happen or not?

I am not sure how I can use my custom mesh on the playground. I am getting CORS errors there. However using a mesh from the playground: https://playground.babylonjs.com/#4HUQQ#1863

Works with me. It’s no .glb file though. Collisions are always reported by the camera.

The cors errors likely come from the policies of the browser. You’ll need a secure connection and a reliable source to import your assets in the pg, as explained here:

1 Like

Thank you, so I got this working here https://playground.babylonjs.com/#4HUQQ#1880

So I think I must have made some kind of mistake in my code, so I don’t think the issue is babylon related. Thank you :smiley:

EDIT: Yes, the error definitely lies in my component somewhere.

EDIT: The issue was/is occurs when I scale the object

1 Like