Check collision for a basic case not working

Hi, I am using one of the examples from the playground and I enabled checkcollision=true …but for some reason it does not work; could you please let me know what I am doing wrong.

Apologies in advance for some basic mistake :frowning:

https://playground.babylonjs.com/#UZ23UH#344

I suppose this might be because the checkcollision only checks the collision between the camera and the object … not between two objects …

you can enable checkCOllisions between objects but you need to move them with mesh.moveWithCollisions API

Many thanks for this suggestion; I added the moveWithCollisions and it now detects collision after getting half way in the mesh ,… I am guessing I need to add some sort of an imposter object … that has.a larger dimension so that the collision is detected sooner;

Will read the documentation and see how I can fix this; for now I just added one line into the playground

https://playground.babylonjs.com/#UZ23UH#345

I meant to say bounding box (not imposter) :frowning: – apologies for my ignorance

Setting the ellipsoid value with the right values will get the collision to work correctly: https://playground.babylonjs.com/#UZ23UH#346

Thank you for this! – it works

1 Like