ecb-system-timing

Select Unity DOTS ECBSystem playback boundaries for structural changes.

6|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/dyCuong03/unity-agent-team --skill ecb-system-timing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ecb-system-timing
Source: https://github.com/dyCuong03/unity-agent-team/tree/main/.claude/skills/unity-dots/ecb-system-timing
Command: npx skills add https://github.com/dyCuong03/unity-agent-team --skill ecb-system-timing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents incorrect Entity Command Buffer (ECB) playback timing when using Unity DOTS structural changes, avoiding cases where entities appear too early or too late relative to the SimulationSystemGroup.

Core Features & Use Cases

  • Select BeginSimulation vs EndSimulation: Guarantees structural changes become visible at the intended point in the frame (current frame simulation vs next frame).
  • Guard with RequireForUpdate: Ensures the required ECBSystem singleton exists to avoid runtime exceptions in custom worlds or test environments.
  • Safe ECB lifecycle guidance: Prevents caching the ECB across frames and documents how to create the command buffer during OnUpdate.

Quick Start

Add state.RequireForUpdate<BeginSimulationEntityCommandBufferSystem.Singleton>() in OnCreate and create your ECB in OnUpdate from that singleton before issuing structural commands.

Frequently Asked Questions about ecb-system-timing

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

FAQPage Schema
How do I choose between BeginSimulation and EndSimulation EntityCommandBufferSystem in Unity DOTS?

Use BeginSimulationEntityCommandBufferSystem for structural changes visible in the current frame simulation, and EndSimulationEntityCommandBufferSystem for next frame visibility. Selecting the correct ECB playback boundary ensures deferred structural operations synchronize properly with the SimulationSystemGroup phase.

Why does my Unity DOTS EntityCommandBuffer cause runtime exceptions in custom worlds?

Runtime exceptions occur when the required ECBSystem singleton is missing. Add state.RequireForUpdate<BeginSimulationEntityCommandBufferSystem.Singleton>() in OnCreate to guard ISystem execution, ensuring the singleton exists before attempting to create an EntityCommandBuffer during OnUpdate.

What is the correct lifecycle for creating an EntityCommandBuffer in an ISystem?

Create a fresh EntityCommandBuffer during OnUpdate by requesting it from the ECBSystem singleton. Avoid caching the ECB across frames, as structural changes must be recorded and played back within the same frame boundary to prevent stale command execution.

When should I use RequireForUpdate with ECBSystem singletons in Unity ECS?

Use RequireForUpdate with ECBSystem singletons when an ISystem issues deferred structural changes. This guard prevents the system from updating in custom worlds or test environments where the specified BeginSimulation or EndSimulationEntityCommandBufferSystem singleton has not been initialized.

Why do my deferred entity creations appear a frame too late in Unity DOTS?

Deferred structural changes appear late when using the wrong ECB playback boundary. If you need entities visible during the current frame simulation, select BeginSimulationEntityCommandBufferSystem instead of EndSimulationEntityCommandBufferSystem to apply the recorded commands at the correct frame phase.