@mcmorry i use the old scripts that’s why i use app instead of this.app and the error is just [playcanvas-stable.dbg.js:0]: Script error. so i thought that someone more expert could see an error without having to go through a step by step debugging since i have a very slow connections where i am right now
oh right i remember i read something about that thanks @yaustar will give it a try with https.
Edit: no that was not the problem so usedd chrome and got this
WebGL: INVALID_ENUM: bindTexture: invalid target
playcanvas-stable.dbg.js:5476 WebGL: INVALID_ENUM: bindTexture: invalid target
setTexture @ playcanvas-stable.dbg.js:5476
playcanvas-stable.dbg.js:5476 WebGL: INVALID_ENUM: bindTexture: invalid target
setTexture @ playcanvas-stable.dbg.js:5476
playcanvas-stable.dbg.js:5476 WebGL: INVALID_ENUM: bindTexture: invalid target
setTexture @ playcanvas-stable.dbg.js:5476
playcanvas-stable.dbg.js:5476 WebGL: INVALID_ENUM: bindTexture: invalid target
setTexture @ playcanvas-stable.dbg.js:5476
playcanvas-stable.dbg.js:5476 WebGL: INVALID_ENUM: bindTexture: invalid target
setTexture @ playcanvas-stable.dbg.js:5476
playcanvas-stable.dbg.js:5476 WebGL: INVALID_ENUM: bindTexture: invalid target
setTexture @ playcanvas-stable.dbg.js:5476 www.lostinn.com/shipfinal.json Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID
6[.Offscreen-For-WebGL-00000288751339A0]RENDER WARNING: there is no texture bound to the unit 0
396696:1 [.Offscreen-For-WebGL-00000288751339A0]RENDER WARNING: there is no texture bound to the unit 0
396696:1 [.Offscreen-For-WebGL-00000288751339A0]RENDER WARNING: there is no texture bound to the unit 0
And no, i’m using the editor and just wanted to recover the ship model from my website, i added the missing file but i still have the error
[396696?debug=true:1]: Uncaught SyntaxError: Unexpected end of JSON input
SyntaxError: Unexpected end of JSON input
at JSON.parse ()
Ok now i have the entity (yesssssss) but the model is without texture, how i add it? this is the code (PS. i use old scripts so i had to use this code @yaustar, your for some reason didn’t work)
var asset = new pc.Asset("Ship", "model", {
url: "https://raw.githubusercontent.com/ayring/kallen/master/shipfinal.json"
});
app.assets.add(asset);
asset.on("load", function (err, model) {
//loaded
});
app.assets.load(asset);
var Ship = new pc.Entity(); // Create an Entity
Ship.addComponent("model", {
type: 'asset',
asset: asset
});
Ship.addComponent('rigidbody', {
type: 'static'
});
Ship.addComponent("collision",{
type:"box",
halfExtents: (0.4,2,10)
});
Ship.name="Ship";
Ship.tags.add("main","sea");
Ship.setEulerAngles(0,90,0);
Ship.setLocalScale(35,35,35);
Ship.enabled=false;
// Add it to the Entity hierarchy
app.root.addChild(Ship);