Search code examples
aframe

Aframe 0.9.0 Set Attribute


In previous versions I set a component on an entity with

entity.setAttribute('component',true)

Now this.data on the component is 'true' rather than the original schema.

i.e. 
AFRAME.registerComponent('component',{
  schema : {
    speed : {default:2},
    visible: {default:true},
  },

init: function(){
   console.log(this.data)  <==== true 
}

Is there a new way of setting a component on an entity?


Solution

  • el.setAttribute('component', '')