Intangible
Marker component that excludes an entity from collision detection. Stateless singleton.
Access
Section titled “Access”// check if entity is intangibleboolean isIntangible = store.getComponent(ref, Intangible.getComponentType()) != null;
// or via archetype check (more efficient in systems)boolean isIntangible = archetype.contains(Intangible.getComponentType());Adding/Removing
Section titled “Adding/Removing”// make entity intangiblestore.ensureComponent(ref, Intangible.getComponentType());
// remove intangibilitystore.tryRemoveComponent(ref, Intangible.getComponentType());For entity holders:
Holder<EntityStore> holder = EntityStore.REGISTRY.newHolder();holder.ensureComponent(Intangible.getComponentType());How It Works
Section titled “How It Works”The TangiableEntitySpatialSystem uses a query that excludes intangible entities:
Query<EntityStore> QUERY = Query.and( TransformComponent.getComponentType(), BoundingBox.getComponentType(), Query.not(Intangible.getComponentType()) // excluded);This means intangible entities:
- Are not in the collision spatial index
- Cannot be hit by collision queries
- Do not block player/entity movement
Additionally, DamageSystems.FilterUnkillable cancels damage to intangible entities.
Common Use Cases
Section titled “Common Use Cases”| Use Case | Why Intangible |
|---|---|
| Warp markers | Visual indicator, shouldn’t block movement |
| Parkour checkpoints | Detection only, no physical presence |
| Projectiles | Prevents self-collision with launcher |
| Editor entities | Tool/debug entities hidden from gameplay |
| Visual effects | Particles, indicators that shouldn’t collide |
Built-in Usage
Section titled “Built-in Usage”// warp entitiesholder.ensureComponent(Intangible.getComponentType());
// parkour checkpointsholder.ensureComponent(Intangible.getComponentType());
// projectilesholder.ensureComponent(Intangible.getComponentType());The /entity intangible [--remove] command toggles intangibility on entities.
Network Sync
Section titled “Network Sync”The component state is synced to clients via ComponentUpdateType.Intangible.
vs Invulnerable
Section titled “vs Invulnerable”| Component | Collision | Damage |
|---|---|---|
Intangible | No | Blocked |
Invulnerable | Yes | Blocked |
Use Intangible for entities that should have no physical presence.
Use Invulnerable for entities that should still collide but not take damage.
Migration System
Section titled “Migration System”Some entity types automatically receive Intangible via TangibleMigrationSystem. For example, entities with ProjectileComponent are auto-migrated to be intangible.