I\'m trying to detect when the user has clicked on a specific cube in my 3d scene I\'ve seen a few similar questions but none seem to have quite the same problem as me.
You need to pass in a single array of objects into
var intersects = raycaster.intersectObjects( objects );
If the objects array is hierarchal (i.e., one of the objects has a child), then you need to specify it this way:
var intersects = raycaster.intersectObjects( objects, true );
You can also pass in scene.children
.
This function will not work with your "cubes" data structure.
three.js r.54