bevy-timers

Manage time-based actions in Bevy 0.19 games with timer resources, components, and Local timers.

125|10|Updated Nov 22, 2022
One-click install
npx skills add https://github.com/nolantait/bevy-starter --skill bevy-timers
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: bevy-timers
Source: https://github.com/nolantait/bevy-starter/tree/main/.agents/skills/bevy-timers
Command: npx skills add https://github.com/nolantait/bevy-starter --skill bevy-timers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bevy timers provide a structured way to drive time-based behavior in Bevy games by modeling countdowns, cooldowns, and recurring actions using timers.

Core Features & Use Cases

  • Timer as a resource to drive global time-based events across the app.
  • Timer as a component attached to entities to manage per-entity cooldowns.
  • Local timers for frame-scoped timing within systems.
  • Clear semantics for TimerMode::Once vs TimerMode::Repeat and the tick/finished/just_finished state.

Quick Start

Create a resource timer, attach it to an entity as a component, or use a Local<Timer> and tick each frame to react when it finishes.

Frequently Asked Questions about bevy-timers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage time-based actions and cooldowns in Bevy?▼

Bevy timers manage time-based actions by tracking the progression and completion of timer objects using tick(time.delta()). You can model countdowns, cooldowns, and recurring actions by checking finished() or just_finished() states every frame.

What is the difference between TimerMode::Once and TimerMode::Repeat in Bevy?▼

TimerMode::Once runs a single countdown cycle and stops, while TimerMode::Repeat automatically resets the timer upon completion. These modes allow you to drive both one-time delayed events and continuous recurring actions within your Bevy systems.

How do I attach a timer to an entity for per-entity cooldowns in Bevy?▼

You can attach a timer as a component to individual entities to manage per-entity cooldowns. Ticking the component-stored timer each frame allows you to independently track and trigger time-based actions specific to that entity.

Can I use Local timers for frame-scoped timing within Bevy systems?▼

Yes, Local timers enable frame-scoped timing within individual Bevy systems. By inserting a Local<Timer> and calling tick(time.delta()), you can manage system-internal timing logic without needing global resources or entity components.

Does this Bevy timer approach support accessing duration and elapsed fractions?▼

Yes, Bevy timers expose duration, reset, and fraction access for precise control. You can query the elapsed fraction to drive continuous animations or progress bars alongside standard finished and just_finished state checks.

Why use a Bevy timer as a resource instead of a component?▼

A Bevy timer as a resource drives global time-based events across the entire app, whereas component timers manage per-entity cooldowns. Resources are ideal for centralized scheduling where multiple systems need to react to a single shared countdown.