quick question, if i wanted to make another 1 spawn at 15 seconds how would i do it, this code i used seems to not work.
var Spawner = pc.createScript('spawner');
// initialize code called once per entity
Spawner.prototype.initialize = function() {
this.Spawner = 0;
this.isSpawnerActive = false;
};
Spawner.prototype.beginSpawner = function(){
this.isSpawnerActive = true;
};
// update code called every frame
Spawner.prototype.update = function(dt) {
this.Spawner += dt;
if (this.Spawner > 5 && this.isSpawnerActive === false) {
this.beginSpawner();
var Monster1 = this.app.root.findByName('Monster1');
this.F = Monster1.clone();
Monster1.parent.addChild(this.F);
this.F.rigidbody.teleport(-12, 1, -4);
}
if (this.Spawner > 15 && this.isSpawnerActive === false) {
this.beginSpawner();
var Monster2 = this.app.root.findByName('Monster1');
this.G = Monster2.clone();
Monster2.parent.addChild(this.G);
this.G.rigidbody.teleport(-12, 1, -4);
}
};