diff --git a/index.js b/index.js index a239581..d49a688 100644 --- a/index.js +++ b/index.js @@ -34,7 +34,11 @@ ctx.clearRect(0,0,this.data.width,this.data.height); var texture = new THREE.Texture(this.canvas); var material = new THREE.MeshBasicMaterial({ map: texture, transparent: true }); - this.el.object3D.children[0].material = material; + + //HACK: on the build of aframe i'm using child[0] is not immediately available + setTimeout(function(){ + _this.el.object3D.children[0].material = material; + },100) if(!this.frame) { this.frame = document.createElement("iframe"); diff --git a/package.json b/package.json index f52e5c5..d3e2e40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aframe-html", - "version": "0.0.3", + "version": "0.0.4", "description": "A component rendering and interacting with HTML in VR", "main": "index.js", "scripts": {