ecspresso
    Preparing search index...
    • Create a one-shot Timer to drop into a timers slot.

      The timer fires justFinished for one frame on completion and then idles (active = false). The entity is left alone — if the slot's lifetime coincides with the entity's lifetime (vfx, blasts, summon-anim), despawn the host yourself in onComplete or in a system that watches justFinished.

      Type Parameters

      • Slots extends string = string

      Parameters

      Returns Timer<Slots>

      ecs.spawn({
      fighter: true,
      timers: { launch: createTimer(2.0) },
      });

      // Self-destructing vfx — caller owns the despawn:
      ecs.spawn({
      timers: {
      fade: createTimer(1.0, {
      onComplete: ({ entityId }) => ecs.commands.removeEntity(entityId),
      }),
      },
      });