Creates actors from templates at runtime.
Systems get it in options.actorSpawner, behaviors in their options too.
options.actorSpawner
const bullet = this.actorSpawner.spawn(BULLET_TEMPLATE_ID);scene.appendChild(bullet); Copy
const bullet = this.actorSpawner.spawn(BULLET_TEMPLATE_ID);scene.appendChild(bullet);
Creating and destroying actors
Creates an actor from a template, with the child actors of the template.
The new actor does not belong to any scene. Append it to a scene or to another actor to add it to the game.
The id of the template.
The new actor.
Error If there is no template with this id.
Creates actors from templates at runtime.
Systems get it in
options.actorSpawner, behaviors in their options too.Example
See
Creating and destroying actors