beScript.onStart = function () {
var exp = STU.Experience.getCurrent();
var template = exp.getActorTemplateByName("SphereTemplate");
if (template !== null && template !== undefined){
for (var i = 0; i < 10; i++){
var options = {
name: "Test",
parent: null,
incrementName: true,
onInstantiationSuccess: function (iInstance) {
console.log("New instance " + iInstance.getName() + " created successfully");
var trans = new DSMath.Vector3D(i * 1000, 0, 0);
iInstance.translate(trans);
},
onFailure: function (iInstance) { console.log("Error during instantiation"); }
};
template.createDynamicInstance(options);
}
}else{
console.log("Error: template not found");
}
};