Indexed property
Bind a C# indexer such as this[int] straight from the picker, point its index at a constant or a Blackboard variable, and read, write, or test exactly one entry without writing a wrapper.
On this page
A C# indexer is a property with a key. Pick it in the member picker like any other property, give its index a value, and the graph reads, writes, or tests the one entry that index names. The other entries never hear about it.
The problem
Section titled “The problem”Dungeon Heist’s PatrolRoute holds four waypoints, each with its own idle pause. The designer wants one of those pauses tuned from the graph, and wants to choose which one without touching the other three. Without an indexer binding that means a wrapper method per entry, or a SetPause(int, float) helper written just to make the graph happy, and a Blackboard full of copies that drift from the route.
PatrolRoute already exposes float this[int index] over the same data GetIdlePauseSeconds reads. Guard2.bqbehavior binds that indexer once: the index comes from the linked_waypoint_index variable, the value from linked_waypoint_pause_seconds, and the write lands on exactly one waypoint.
When to reach for it
Section titled “When to reach for it”- One entry of an ordered set is the graph’s business: a waypoint pause, a lane speed, an inventory slot. Dungeon Heist’s Guard_2 selects a waypoint by number and changes that waypoint’s pause.
- A member condition should ask about one entry:
this[linked_waypoint_index] ≥ 6tests the selected waypoint and no other. - Your component already offers an indexer, and you would rather not add a method whose only job is to forward an index.
See it
Section titled “See it”
linked_waypoint_index reads 2, so typing 12 into the surfaced linked_waypoint_pause_seconds card in Live writes waypoint 2’s pause. Guard_2 reaches waypoint 2 and stands there for twelve seconds, then walks on to waypoint 3 and waits its ordinary four. Played at three times game speed so both pauses fit in one loop.
![The member picker on PatrolRoute filtered to the indexer row: float this[int index] with get and set, its chips reading Read · Write and 1 index arg](/media/dungeon-heist/guides/indexed-picker-signature.png)
1 index arg says how many values you owe it; Read · Write says which directions its declaration allows.
The walkthrough adds a property node to Guard_2’s patrol in Dungeon Heist. Any component with a public indexer works the same way.
-
Open
Assets/_Project/Behavior/Guard2.bqbehaviorin Static, select the patrol Sequence, click + on its row, and choose property under ACTIONS. -
In Target, choose Reference, click Target type, and pick
PatrolRoute. In Play Mode the game fills Object with Guard_2’s ownRoute_NorthEast; in Edit Mode the row says no Agent runs the graph yet, which is fine for authoring. -
Click Member > Change, open Properties, and type
this. The one row left isfloat this[int index] { get; set; }. Pick it. The Member card’s Name row now readsthis, and an Arguments card appears with one row,index int. -
On the
indexrow choose Blackboard and picklinked_waypoint_index. The variable picker offers onlyintvariables; everything else is struck through with the reason.
Figure 3. An index takes its exact type. The picker says so on every row it rules out: a float value is not int, and argument 0 requires that exact type with no conversion. -
In Binding, choose write. The Blackboard row names the node’s own surfaced value,
Itemuntil you rename it in the Blackboard panel’s Member bindings list. The card on the canvas now shows both ends: the index it reads and the value it writes.
Figure 4. The node card on the canvas, titled set waypoint pause, listing linked_waypoint_index as its read and selected_waypoint_pause as its write, tagged ACTION · PROPERTY -
Press Cmd/Ctrl+S. Saving regenerates the member provider, which is what lets Play Mode compose the new binding.
Bind it once for the whole graph
Section titled “Bind it once for the whole graph”An indexer does not need a node. Guard2.bqbehavior binds PatrolRoute.this[int] at graph level, with no node of its own, and surfaces the written value as linked_waypoint_pause_seconds. Open the graph in Static with nothing selected, expand that row under Member bindings, and it states its type and direction: BLACKBOARD → MEMBER · PatrolRoute.Item. The index it uses, linked_waypoint_index, is recorded in the graph file beside it.

In Live that same binding is a card with a writable Current row, because its direction is write. Type a number and the running guard’s route changes at once, at the waypoint the index names and at no other. The card’s Source row then reads runtime edit with the number you typed, and its details name the exact member it reached: PatrolRoute.Item, direction blackboard → member.

4, 4, 12, 4: one entry took the twelve, the other three still hold their authored four.How it decides
Section titled “How it decides”Result
- Success
- The access completed on the addressed entry: a read filled the variable, a write reached the indexer, a condition's comparison held.
- Failure
- The comparison did not hold, or the target did not resolve this evaluation. An indexer that throws for its index is a recorded fault, never an authored Failure.
- Running
- Nothing here waits. An indexer access finishes inside the evaluation that started it.
The index
- One Arguments row per index parameter, in declaration order, each with exactly two sources: Constant or Blackboard. There is no Default and no Project for an index.
- An index argument must match its parameter’s type exactly. No widening, no enum to int, none of the conversion set that ordinary arguments enjoy. A
floatvariable is never offered for anintindex. - A Blackboard index is read again on every evaluation, so a changed variable addresses a different entry on the next tick with no rebind.
- An index outside the collection’s range is the indexer’s own business:
PatrolRouteasserts, your component may throw, and a throw is recorded as a fault for that evaluation. Nothing clamps or redirects it.
The accessors
- The picker shows what the declaration offers:
{ get; set; },{ get; }, or{ set; }, and the row’sRead · Writechip says the same thing. - A direction the declaration cannot serve is blocked on exactly that direction. A getter-only indexer blocks write and two-way; a setter-only indexer blocks read and any member condition. The Binding card reads ACCESSOR UNAVAILABLE, names the missing accessor, and offers Choose Read or Choose Write to switch to the direction that exists, plus Change property. A member condition has no direction to switch, so it offers only Change property.
- two-way needs both accessors. It never degrades to a one-way binding when only one exists.
Identity and saving
- Same-named indexers that differ by index count, order, or type are different members. The picker lists each with its own signature, and the graph file records the exact one you chose.
- Saving and reopening restores the ordered index tuple as authored: each row’s source, its constant, or its variable name stays paired with its parameter. An unchanged reopen never rewrites the file.
- Every admitted index shape authors through the same row. An
inindex parameter gets an ordinary row. A trailingparamsindex parameter gets one required row holding a single array-typed Constant or Blackboard value, never the multi-value rail a method’sparamsparameter offers.
On the entity path
- An indexer binds on entity agents when its accessor is a direct pass-through to one stored unmanaged container on the component: a
FixedList32Bytes<float>field behindthis[int index], aFixedString, any conforming unmanaged struct, or afixedbuffer. - A container-backed indexer also needs a public
LengthorCountproperty on the same component that reads that field’s own length; the generated access bounds-checks against it and reports an out-of-range index as a fact instead of touching memory. Afixedbuffer has its element count in its declaration, so it needs noLength. - A
paramsindex, a managed index type, or an accessor that computes rather than forwards is refused on the entity picker with that reason, and the GameObject path is named as the way to bind it.
When it goes wrong
Section titled “When it goes wrong”When it goes wrong
| Symptom | Check | Fix |
|---|---|---|
| The variable I want is not offered for the index. | Compare its declared type with the index parameter type. The picker strikes through every mismatch and says why. | Declare a variable of the exact index type. An index takes no conversion, so an int index needs an int. |
| The Binding card reads ACCESSOR UNAVAILABLE. | Read which accessor it names. The declaration has no setter for a write, or no getter for a read or a condition. | Click Choose Read or Choose Write to take the direction that exists, or Change property, or add the accessor in C#. |
| Two-way is refused on an indexer that has a getter. | A two-way binding needs both get and set on the same indexer. | Add the setter, or choose read. |
| The node faults instead of running. | Open Live and read the index value. It is probably outside the collection, and the indexer threw. | Clamp or validate the index in the code that writes the variable. The binding passes it through as written. |
| I changed the index and the old entry kept the value. | That is the rule: a write changes the entry it addressed and leaves it there. | Write the old entry again with the value you want before moving the index on. |
| The entity picker refuses an indexer that the GameObject picker accepts. | Read the reason on the row: a params index, a managed index type, a computing accessor, or a missing Length or Count. | Forward one stored unmanaged container and expose its Length or Count, or bind it on the GameObject path. |
- Property and field: the direction rules this page builds on.
- Arguments and results: every other argument source, and why they differ from an index.
- Dungeon Heist: move the long pause from one waypoint to another and watch the guard.
- Member nodes and bindings: the field list for the Arguments and Binding cards.