Can't see cube, even though I can hit it with raycast?

I would like to use the Epilit demo scene with some sound design students. A simple idea we had was to place cube around the scene to trigger various sounds as the player navigates the different areas. So we added a simple box, code below, but it’s completely invisible.

    box = new BABYLON.MeshBuilder.CreateBox('Box', { size: 1, width: 1, depth: 1 }, scene);
    box.material = new BABYLON.StandardMaterial("Mat", scene);
    box.material.diffuseColor = new BABYLON.Color3.Red();

I added a raycast to check if the box is there, and it appears it is, we just can’t see it?

Any ideas? Could it have something to do with the lighting?

No idea why, but the box does show on Glowing Espilit:

https://www.babylonjs.com/demos/glowingespilit/

Thanks for checking :+1: I’ll take a look again tomorrow and see if I can see what’s going on.

I just tried it with the Glowing version of Espilit and it works fine. I probably botched up the other version somehow! All good now, thanks again for confirming it worked on your end. :+1:

3 Likes