cross-entity-lookup

Community

Read other entities safely in DOTS.

AuthordyCuong03
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Cross-entity lookup solves the challenge of reading component data from entities that are not part of the current ECS iteration, without breaking job safety or wasting performance on managed calls and unnecessary copies.

Core Features & Use Cases

  • Snapshot copy for simple read-only needs: Use ToComponentDataArray<T> when you want a disposable, frame-scoped read-only view of another set of entities.
  • Random-access reads via ComponentLookup: Use SystemAPI.GetComponentLookup<T>(true) to fetch component data by entity ID, including inside jobs.
  • Job safety and performance guardrails: Prefer [ReadOnly] lookups and correct allocators (state.WorldUpdateAllocator) to avoid invalid memory lifetimes and false dependency chains.

Example use case: targeting and nearest-neighbour style logic where an agent iterates its potential targets, then reads Health or LocalTransform from those target entities even though they are not co-iterated with the current query.

Quick Start

Tell the AI to show how to read Health for a list of target entities inside a Burst job using ComponentLookup<Health> marked as [ReadOnly].

Dependency Matrix

Required Modules

None required

Components

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: cross-entity-lookup
Download link: https://github.com/dyCuong03/unity-agent-team/archive/main.zip#cross-entity-lookup

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.