How to detect child objects in .gltf model with Three.js raycaster?

I’m trying to learn Three.js raycaster. I have simple gltf model and I’m trying detect objects in gltf model. For example i want to click house in gltf model and my camera zooming to house. But my raycaster only detect gltf model, not house. Anybody can help me thank you.

my codepen:
i don’t upload gltf model on codepen but i load github
gltf-model/medieval_fantasy_book at master · alibaverkahraman/gltf-model · GitHub

Can you try without ‘true’ parameter to detect child objects.

const intersects = rayCaster.intersectObjects(model,true);

const intersects = rayCaster.intersectObjects(model);

1 Like