wave5-local-to-world-read-only-contract

Enforce read-only LocalToWorld access for world-space calculations in Unity DOTS.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents incorrect and unstable gameplay or spatial logic caused by writing to LocalToWorld or reading it at the wrong time in the ECS transform pipeline.

Core Features & Use Cases

  • Read-only LocalToWorld contract: Use LocalToWorld to obtain world-space position/orientation for rendering, physics queries, and spatial calculations.
  • Scheduling and freshness guidance: Avoid stale last-frame data by reading after TransformSystemGroup runs or accepting explicit latency.
  • Correct motion ownership: Write movement via LocalTransform so TransformSystemGroup can compute and propagate LocalToWorld safely.

Quick Start

Ask your AI to refactor your system so that any world-space reads use in LocalToWorld (e.g., LocalToWorld ltw in IJobEntity) while all entity motion writes go through LocalTransform, scheduled to run after TransformSystemGroup.

Frequently Asked Questions about wave5-local-to-world-read-only-contract

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

FAQPage Schema
Why are my Unity DOTS spatial queries returning incorrect LocalToWorld values?

Incorrect LocalToWorld values in Unity DOTS usually happen when reading the value before TransformSystemGroup executes or when gameplay writes corrupt the composed parent-chain transform. Treat LocalToWorld as strictly read-only after the transform system updates to ensure spatial queries use correct world-space positions.

How do I safely read LocalToWorld in an ECS job for physics queries?

To safely read LocalToWorld in an ECS physics query job, declare it with read-only access like `in LocalToWorld` in IJobEntity, and schedule the job to run after TransformSystemGroup so the world transform is freshly computed and uncorrupted by concurrent gameplay writes.

Should I write to LocalTransform or LocalToWorld for entity movement in Unity DOTS?

You should write entity movement to LocalTransform, not LocalToWorld. TransformSystemGroup then computes and propagates the composed world-space transform safely, ensuring rendering and spatial calculations rely on an uncorrupted LocalToWorld value across parent-child hierarchies.

When do I need to enforce a read-only LocalToWorld contract in Unity ECS?

You need to enforce a read-only LocalToWorld contract whenever systems require composed parent-chain transforms for root and child entities, such as Unity DOTS rendering, physics queries, and culling, to prevent unstable spatial logic from gameplay write conflicts.

Can I use stale LocalToWorld data from the last frame for spatial calculations?

You can use stale last-frame LocalToWorld data only if you accept explicit latency in your spatial calculations. For fresh, accurate world transforms, you must schedule your read-only systems to run after TransformSystemGroup executes.