dots-spawning-patterns
CommunitySpawn ECS entities fast, safely, deterministically.
System Documentation
What problem does it solve?
It solves slow or incorrect entity spawning in Unity DOTS by showing efficient, deterministic patterns that avoid common performance traps and runtime failures.
Core Features & Use Cases
- Batched main-thread spawning: Instantiate a prefab Entity in one call, write per-entity data afterward, and manage
Allocator.Tempcorrectly for fast bursts. - ECB-based job spawning: Spawn entities from parallel jobs using
EntityCommandBuffer.ParallelWriterwith[ChunkIndexInQuery], ensuring correct deferred playback. - Deterministic randomness: Use Burst-friendly
Unity.Mathematics.Randomwith seededCreateFromIndexto keep replays and tests consistent. - Safety via gating and guardrails: Apply
RequireForUpdate<T>to prevent missing singletons, and follow anti-patterns to avoid invalid code paths.
What problem does it solve?
Guidance focuses on implementing spawners for enemy waves, projectile fire, particle-like ECS entities, and any “create N entities per frame (or burst)” systems that must stay performant and replay-stable.
Quick Start
Follow the main-thread or ECB job pattern in the guide to spawn your prefab Entity in batches while using Random.CreateFromIndex with a non-zero deterministic seed.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: dots-spawning-patterns Download link: https://github.com/dyCuong03/unity-agent-team/archive/main.zip#dots-spawning-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.