dacha
    Preparing search index...

    Interface ActorSpawner

    Creates actors from templates at runtime.

    Systems get it in options.actorSpawner, behaviors in their options too.

    const bullet = this.actorSpawner.spawn(BULLET_TEMPLATE_ID);
    scene.appendChild(bullet);
    Index
    • 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.

      Parameters

      • templateId: string

        The id of the template.

      Returns Actor

      The new actor.

      Error If there is no template with this id.