Ara
Download

Search or run a command

Jump to a section or open an Ara link.

Component · physics2d

TileColliderSource2d

Ownership marker for generated colliders, separate from gameplay body state.

Fields

owner

entity
Map entity whose tiles generated this collider.
default null

Usage

Every edit is an undoable command: from the CLI as below, or the same JSON from an agent over MCP. See component.add and property.set.

Add it

ara do component.add -p entity=name:Crate -p component=TileColliderSource2d --why "Add TileColliderSource2d"

Set a field

ara do property.set -p entity=name:Crate -p path=TileColliderSource2d.owner -p value=null --why "Tune TileColliderSource2d"

In a scene document

{
  "TileColliderSource2d": {
    "owner": null
  }
}

From C#

/// <summary>Associate generated tile collision with its source tilemap.</summary>
public static void UseTileColliderSource2d(Entity entity, in Tick tick)
{
    ref var component = ref World.Get<TileColliderSource2d>(entity);
    component.Owner = "e_tilemap";
}

From C#

Scripts read and write it with Get<TileColliderSource2d>(); see the TileColliderSource2d struct.