I have a template object which has two scripts attached to it. When I create an instance of this template, the scripts are no longer attached.
It seems like the only component that is included is the render component. There should be collision and rigid body components as well.
TargetSpawner.prototype.postInitialize = function() {
this.targetTemplate.ready(() => {
this.spawnTarget();
});
this.app.assets.load(this.targetTemplate);
};
TargetSpawner.prototype.spawnTarget = function() {
var newTarget = this.targetTemplate.resource.instantiate();
newTarget.enabled = true;
this.app.root.addChild(newTarget);
console.log(newTarget);
};
Here is a screenshot of the template object properties
And here is the console output of newTarget from the code above
Is this how templates are supposed to work or am I missing something?