Problems with collisions in a imported mesh

Hello everyone,
i try collide the camera and imported mesh, but i can’t.
i make a test with a camera and the primitive mesh (cube and sphere) and works fine.
when i import the mesh in the function in every mesh active the checkcollisions, but don’t works.
the code is bellow

var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, new BABYLON.Vector3.Zero(), scene);
        camera.attachControl(canvas, false);
        camera.checkCollisions = true;

    
        
      // CARGA MODELO
        BABYLON.SceneLoader.ImportMesh("", "", "scene.glb", scene, function (meshes) {
            camera.target = meshes[0];
            for(const mesh in meshes)
            {
              mesh.checkCollisions = true;
            }


thanks for your help :smiley:

This thread might help Problem with import glb and collisions Basically, the setup is often the issue.

Might be easier if you were able to provide a repro in the playground ?

the thread really helped me.
the setup is the issue, only i added this lines

meshes[0].checkCollisions = true;
                meshes.forEach(mesh => {
                    mesh.checkCollisions = true;
                })

and worked right.
Thanks a lot

1 Like