help,GLTF not draggable

bone_test.glb (511.2 KB)

[ example file ] (632.1 KB)

			var loader = new THREE.GLTFLoader();
			loader.load( `../temporarilyFile/bone_test.glb`, ( gltf ) => {
				this.scene.add( gltf.scene );
				gltf.scene.traverse( function( object ) {
					if ( object.isMesh ) objects.push( object );
				} );

			var dragControls = new THREE.DragControls( objects, camera, renderer.domElement );
			dragControls.addEventListener( 'dragstart', function ( event ) { controls.enabled = false; });
			dragControls.addEventListener( 'dragend', function ( event ) { controls.enabled = true; });

The object has draggable event set The object is not actually moved

I think you need to put gltf.scene into the array of draggable objects, not the individual meshes. Mesh positions are controlled by bones if this is a skinned mesh (which from the filename it seems to be).

DragControls likely won’t raycast scene’s children:

Hm. In that case I’m not sure how to use it with a SkinnedMesh. The raycaster would at least need the recursive=true option with the scene then. Whether that fixes the issue I don’t know. The problem is that you need to move the bone or a parent, not the mesh, but can’t raycast against the bone.

I solved this problem by creating a secondary cube, binding the drag controls to that, and then updating the gltf.scene to the position of the cube being dragged.

In the meanwhile, DragControls has limited support for dragging entire groups. More information here: