Hi there, seems like it’s impossible to create new pc.Css3Plane()
once the app/game is already started, or am I doing something wrong?
var IframePlane = pc.createScript('iframePlane');
IframePlane.prototype.initialize = function() {
this.iframeUrl = 'https://www.youtube.com/embed/aqz-KE-bpKQ';
var element;
if (this.iframeUrl) {
element = document.createElement("iframe");
element.src = this.iframeUrl;
element.style.border = '0px';
} else {
element = null;
}
this._css3Plane = new pc.Css3Plane(element, this.entity, 640);
var material = new pc.StandardMaterial();
material.depthWrite = true;
material.redWrite = false;
material.greenWrite = false;
material.blueWrite = false;
material.alphaWrite = false;
material.blendType = pc.BLEND_NONE;
material.opacity = 0;
material.update();
this.entity.render.material = material;
this.on('enable', function() {
this._css3Plane.enable();
}, this);
this.on('disable', function() {
this._css3Plane.disable();
}, this);
};
This script gets created on entity after some gameplay(not on app start)
Uncaught TypeError: pc.Css3Plane is not a constructor
Even if you type var test = new pc.Css3Plane();
in dev tools same error is appearing