Hi Guys,
I was wondering if there was a way to have the mesh return to it’s original position on drag-end when using drag controls. I have a gltf file with multiple meshes, and each mesh has been assigned to a variable using getObjectByName()
This is what I have so far for the drag controls:
var dragControls = new THREE.DragControls( objects, camera, renderer.domElement );
dragControls.addEventListener( 'dragstart', function ( event )
{
dragControls.enabled = true;
});
dragControls.addEventListener( 'dragend', function ( event )
{
dragControls.enabled = false;
if (letter_h) letter_h.position.set(-0.04,.02,.05);
if (letter_o) letter_o.position.set(0.04,.02,.05);
if (letter_p) letter_p.position.set(0.12,.02,.05);
});
This kinda works, but it snaps back to position. It would be really cool if I could have them animate back to their original position over like 2 seconds. Any help would be greatly appreciated.