pc.Css3Plane is not a constructor

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

Have you got a script/code that defines the Css3Plane class? Css3Plane is not part of the engine.

1 Like

Oh, silly me, thought it was a part of engine, just found out its in additional script, thanks haha :smiley:

Any other possible ways apart of new pc.Css3Plane to add/bind html elements on entities?
Been lurking in search for a while, couldn’t find any other solutions

The way that CSS3 Plane is to use the CSS transform to transform HTML elements to a size, angle, scale.

So it’s possible to do the same thing without using Css3Plane but you would have to manipulate the HTML and style yourself

That project is also no longer maintained as there are a number of issues with input events and alignment on mobile that are really hard to deal with.

1 Like