Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

instantiate template playcanvas

GameManager.attributes.add('player', { type: 'asset', assetType: 'template'});

GameManager.prototype.initialize = function() {
    //instantiate player
     var newPlayer = this.player.resource.instantiate();
     this.app.root.addChild(newPlayer);
};
 
PREVIOUS NEXT
Tagged: #instantiate #template #playcanvas
ADD COMMENT
Topic
Name
1+5 =