Hello all,
I’m guessing this is related to a recent engine push, but a script that I had that sets tiling and offset on an object is now pushing errors when attempting to set those parameters. The error that I get is:
Uncaught TypeError: a.equals is not a function
and a stack trace of:
Uncaught TypeError: a.equals is not a function
equals https://code.playcanvas.com/playcanvas-stable.dbg.js:12488
set https://code.playcanvas.com/playcanvas-stable.dbg.js:12521
onload https://launch.playcanvas.com/api/assets/files/Gathering Space/Scripts/lbMediaScripts.js?id=49143186&branchId=0e26414b-2c2b-4d2d-9f09-01135c2cdc61:25
initialize https://launch.playcanvas.com/api/assets/files/Gathering Space/Scripts/lbMediaScripts.js?id=49143186&branchId=0e26414b-2c2b-4d2d-9f09-01135c2cdc61:19
Here is the related script that is making causing the trouble:
var LbLitMat = pc.createScript('lbLitMat');
LbLitMat.attributes.add('id', {
type: 'string',
title: 'Content ID'
});
LbLitMat.prototype.initialize = function() {
this.entity.render.meshInstances[1].material = this.entity.render.meshInstances[1].material.clone();
console.log(this.entity.render.meshInstances[1].material);
var self = this;
var image = new Image();
image.crossOrigin = "anonymous";
image.onload = function () {
var texture = new pc.Texture(self.app.graphicsDevice);
texture.setSource(image);
var material = self.entity.render.meshInstances[1].material;
material.diffuseMap = texture;
material.diffuseMapOffset = {x: 0, y:0};
material.diffuseMapTiling = {x: 1, y:1};
material.update();
};
image.src = alliedBasePath + this.id;
};
Any ideas?