Hey i was wondering if i would have to make a whole new script to disable this entity when the new scene loads since the other entitys doesnt follow but this one. here is my code for the menu:
var changeScene = pc.createScript('changeScene');
changeScene.attributes.add('Entity', {
type: 'entity'
});
// Creates a new Scene instance
changeScene.prototype.initialize = function () {
// initialize current root to first scene loaded
//this.enabled = 'attr:entity';
//this.enabled = false;
this.currentRoot = this.app.getSceneUrl();
this.currentLevel = 0;
this.levels = [
722434,
723038
];
};
changeScene.prototype.update = function (dt) {
if (this.app.keyboard.wasPressed(pc.KEY_ENTER)) {
this.loadLevel(this.currentLevel);
}
};
changeScene.prototype.loadLevel = function(level) {
// destroy the current scene
if (this.currentRoot) {
this.currentRoot.disableLevel();
}
this.app.loadSceneHierarchy(this.levels[level]+'.json', function(err, entity) {
});
};
changeScene.prototype.nextLevel = function() {
this.loadLevel((this.currentLevel + 1) % this.levels.length);
};
But when i load into the new scene the play buttton along with the text follows along… I am trying to figure this out by using this.enabled
but when i do so it wont load stays stuck on starting screen…
this.enabled = 'attr:entity';
this.enabled = false;
If anyone knows what could be done i would greatlly appreciate it.
Thanks,
Nathan Hawkins