wave5-stateful-physics-event-buffers

Detect Enter, Stay, and Exit trigger and collision events for Unity Physics entities using DynamicBuffer event systems.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you detect Enter, Stay, and Exit semantics for Unity Physics trigger and collision events without manually tracking overlap history across fixed simulation ticks.

Core Features & Use Cases

  • Stateful trigger tracking: Uses DynamicBuffer<StatefulTriggerEvent> to reliably count or react to overlap lifecycles (Enter/Exit) and optionally handle per-frame persistence (Stay).
  • Stateful collision tracking: Applies the same pattern to collision event lifecycles via Unity Physics stateful collision event buffers.
  • Correct ECS scheduling: Guides the required fixed-step system ordering so you read buffers after the corresponding buffer system runs.

Use when you need gameplay logic like portal/pickup activation, damage zone lifecycle handling, landing detection, or impact response that must distinguish first contact from ongoing contact and final contact.

Quick Start

Add StatefulTriggerEventBufferAuthoring to your trigger-zone entities, ensure your system runs in FixedStepSimulationSystemGroup and is ordered after StatefulTriggerEventBufferSystem, then iterate DynamicBuffer<StatefulTriggerEvent> in a Burst job and branch on StatefulEventState.Enter and StatefulEventState.Exit.

Frequently Asked Questions about wave5-stateful-physics-event-buffers

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

FAQPage Schema
How do I detect Enter, Stay, and Exit trigger events in Unity ECS?

Use a per-entity DynamicBuffer<StatefulTriggerEvent> to track overlap lifecycles across fixed simulation ticks, branching on StatefulEventState.Enter, Stay, and Exit in a Burst job. This stateful event buffer approach eliminates manual overlap history tracking for reliable trigger lifecycle detection.

What is the correct system ordering for processing stateful physics event buffers?

Schedule your system in the FixedStepSimulationSystemGroup and order it after StatefulTriggerEventBufferSystem or StatefulCollisionEventBufferSystem. This fixed-step ordering ensures you read populated event buffers only after the physics simulation updates them for the current tick.

How do I handle collision lifecycles for damage zones and landing detection in Unity DOTS?

Apply the stateful collision event buffer pattern via DynamicBuffer<StatefulCollisionEvent> to distinguish first contact, ongoing contact, and final contact. This enables precise impact response and damage zone lifecycle management across fixed ticks for reliable landing detection in Unity DOTS.

Do I need specific authoring components to enable stateful trigger tracking?

Yes, you must add StatefulTriggerEventBufferAuthoring to your trigger-zone entities. This authoring component initializes the required DynamicBuffer for storing stateful physics events, enabling ECS gameplay logic like portal activation and pickup detection to function reliably.

Why does my stateful physics event buffer miss overlap events during fixed step updates?

Missing overlap events during fixed step updates typically occur if system ordering is incorrect or buffer processing mishandles Enter, Stay, and Exit states. Ensure your system runs after StatefulTriggerEventBufferSystem to read valid event data and safely process the physics trigger lifecycle.