Collision performance on imported dummy model is horrible [Playground link inside]

How do I get the same good performance when colliding with the dummy model ?

The collision with the crate works great but with the dummy brings performance to a halt.

Probably has to do something with actually computing the collision for each tiny bit of the model’s mesh.

Is there any way to set it an actual bounding box for it and if yes, how ?

[EDIT 1 ] Babylon.js Playground

After disabling collision check on the dummy model and I implemented an invisible box as a child of the dummy model that acts like collision barrier/bounding box and activating the collision check on said invisible box it seems to work good enough.

It feels silly/dirty though. Does BabylonJS have an in-built way to do these kind of things ? Cause really having pixel perfect collisions seems not good in general scenarios.

Hello and welcome!

The built-in way is the one you used :slight_smile: We have no way to decide for you if you want precise collisions or not unfortunately.

Impostors (the way you did it: having an invisible box to replace the real model) is widely used in the industry. You can check this demo for instance: Babylon.js - Espilit demo

All collisions are done using invisible boxes to get the best performance

So no worries this is not dirty :smiley:

1 Like

Oh thanks for replying. It’s my first time using this type of forum for a product I use and I was worried no one’s gonna help me !

The demo looks very gamey so it’s obvious they used a similar way cause they have an immense amount of meshes in the scene with no performance drops.

After checking your profile, I want to thank you for helping create such a useful tool. Everyday I used it proves itself the right tool tο create a small FPS game I have in mind as part of my thesis and I really can’t figure out how you have such an awesome documentation,so detailed and a low number of open issues in github.

Excellent. I hope one day I can be just like you.

You will soon find that our community is welcoming and pretty fast to answer questions :slight_smile:

Thanks a lot for your kind words by the way