I found a great example of drag and drop functionality using this link. It worked perfectly for individual objects, but now I want to group some elements together to drag and drop them as one unit. To achieve this, I replaced the cubes in the example with spheres and grouped them using Object3D().
var data = [[0,10],[50,20],[100,7],[150,18],[200,15],[250,3],[300,10],[350,25]];
var group = new THREE.Object3D();
for(var i = 0; i< data.length; i++){
var mesh = new THREE.Mesh( new THREE.SphereGeometry(data[i][1],20,20), sphereMaterial);
mesh.position.y = data[i][0];
mesh.updateMatrix();
group.add(mesh);
}
objects.push(group);
scene.add(group);
However, I'm facing an issue where I can't select this group of objects in my scene. What am I doing wrong? Is it not possible to select a group of objects like this? If so, how should it be done?