jesstelford / aframe-click-drag-component

Aframe Click & Drag Component
https://jesstelford.github.io/aframe-click-drag-component/
MIT License
103 stars 49 forks source link

Not able to click and drag an entity made up of other entities #19

Open pubaayaam opened 7 years ago

pubaayaam commented 7 years ago

@jesstelford @ngokevin I have created a dice entity from six plane entities. However, when I click and drag the dice entity, instead of moving that dice, only one sided face gets dragged. This can be tried hands on at link http://shrouded-chamber-73425.herokuapp.com/

andreiciungan commented 7 years ago

Any news regarding this issue?

pubaayaam commented 6 years ago

It does not work actually

bknill commented 6 years ago

I got round it with this

   setAttributeFamily(el,'click-drag',true)

    function setAttributeFamily(el,attribute,value){
      el.setAttribute(attribute,value)
      const children = [].slice.call(el.children)
      children.forEach((child)=> child.setAttribute(attribute, value))
      if(el.parentNode.classList.contains('hotspot'))
        el.parentNode.setAttribute(attribute, value)
    }