I have a simple Threejs code where I am experimenting with click events using Raycaster. By using the BOX geometry, I have created three cubes in my scene. Additionally, I have utilized CSS2DRenderer.js to add a label above one of the cubes. My goal is to trigger a popup with information when clicking on the label. While clicking on the cubes seems to work fine, clicking on the label does not register any interaction. Is the raycaster only limited to detecting meshes? If so, how can I make it detect clicks on the label as well? Below is the snippet of code handling the click event:
window.addEventListener('click', event => {
raycaster.setFromCamera(clickMouse, camera);
const found = raycaster.intersectObjects(scene.children);
console.log(found);
});