Variable arguments
Bind a method whose last parameter is params, feed it individual values in the order you want or hand it an array or list you already hold, and let the editor catch a wrong-type entry before Play.
On this page
A C# method whose last parameter is params T[] takes as many values as you care to give it. Pick it in the member picker and the Arguments card grows a slot that takes them one at a time, in the order you set, or takes one array or list you already hold. Either way the call gets one array, and your method never knows which form you chose.
The problem
Section titled “The problem”The Platformer’s GraphEnemyPatrol has a patrol call that already exists in C#: AdvanceWaypointPatrol(ref PatrolStop nextStop, ref float pauseProgress, params Transform[] waypoints), whose two ref parameters are the graph’s own next_stop and pause_progress progress values, bound as read-write parameters exactly as the combat enemy’s patrol binds them. The designer wants one enemy to walk the waypoints in numbered order and another to run the same three in reverse from a route array the scene fills in. Without a params slot that means a Transform[] variable per enemy, a node to assemble it, or a developer writing AdvanceThreeWaypoints(Transform, Transform, Transform) just to keep the graph happy.
EnemyPatrolParams.bqbehavior binds the method as declared. Its advance the params patrol node lists three individual values, wp0, wp1, wp2, and Enemy Params walks them in that order. Switch the same slot to Collection and point it at altRoute, which the enemy fills with the same three waypoints reversed, and it walks 3, 2, 1 with no other change.
When to reach for it
Section titled “When to reach for it”- A gameplay method ends in
params: a patrol over any number of waypoints, a sound cue with any number of layers, a spawn call that takes any number of prefabs. - The order matters and you want to author it by eye. Individual values are rows you can drag, so the route reads top to bottom in the rail.
- The values already live in an array or list on the Blackboard, filled by your code or by a scene owner. Collection hands it over as it is.
- A member condition asks a question of several values at once.
RouteContainsWaypointsInOrder(params Transform[])takes the same slot a method node does and answers with a yes or a no.
See it
Section titled “See it”
The shipped node in Individual values with wp0, wp1, wp2. Enemy Params walks to Waypoint 1 under the second ground coin and stops, walks on to Waypoint 2 between the third and fourth coins, then to Waypoint 3 under the fifth, and walks back to the first in one go. The pause is set to a second so each stop reads.

The same node switched to Collection altRoute, nothing else changed. The array holds waypoint 3, 2, 1, so the enemy walks past Waypoint 2 to the far stop first, then comes back through 2 and 1 in reverse.
![The member picker on GraphEnemyPatrol, Methods tab, listing AdvanceWaypointPatrol with its two ref parameters and params Transform[] waypoints, and RouteContainsWaypointsInOrder(params Transform[] waypoints)](/media/platformer/guides/params-picker-signature.png)
params methods on the component, each tagged bool; the patrol call also carries 2 REFS for its progress. The picker spells the declaration out with its params keyword and truncates the long ones; a method and a condition with the same slot shape get the same treatment on their cards.
params tag. Below it, one row per value in call order, and Add value at the end.

The rail during a switch each way: the rows give way to the collection field and a retained-values note, then come back when Individual values is chosen again, with the collection named in its own note.
-
Open
Assets/Platformer/Behavior/EnemyPatrolParams.bqbehaviorin Static. Hover patrol and decide, click its +, and choose method under ACTIONS. Name it and press Enter. -
In Target, Agent is selected. Click Choose a component…, type
GraphEnemyPatrol, and press Enter. Enemy Params carries that component on its own GameObject. -
In Member, click Change, open Methods, and pick
AdvanceWaypointPatrol. An Arguments card appears with one slot,waypointsTransformtaggedparams, the switch on Individual values, the reading0 values, and Add value, beside a Read-write parameters card fornextStopandpauseProgress; bind those to the graph’snext_stopandpause_progressas Arguments and results shows, and this page stays on theparamsslot.
Figure 4. Zero rows is a legal call. The method receives an empty array. -
Click Add value three times. On each new row click BB and pick
wp0, thenwp1, thenwp2. The picker offers only variables that fit one element: the threeTransformvariables are offered, andaltRouteis struck through because an array is not oneTransform.
Figure 5. Each row wants one element, so an array is ruled out with the reason on its row. The Collection form is where an array belongs. -
Read the card on the canvas. Under the method name it lists the Blackboard values the slot reads,
wp0,wp1,wp2, in row order. Drag a row by its grip, or focus the grip and press Alt+Up or Alt+Down, and the order on the card and in the call follow.
Figure 6. The canvas card of advance the params patrol in Individual values, tagged ACTION · METHOD, listing wp0 through wp2 as Blackboard chips under the method name -
Press Cmd/Ctrl+S. The toolbar reads Bindings valid and the status bar Saved. Saving regenerates the member provider, which is what packs the rows into one array for Play.
The same slot on a decision
Section titled “The same slot on a decision”A member condition bound to a bool method with a params tail gets the identical slot, and the result goes to Comparison like any other condition. EnemyPatrolParams.bqbehavior carries two of them under its two route decisions: individual waypoints match route passes wp0, wp1, wp2 and succeeds because the enemy’s patrol holds them in that order, and waypoint array matches route passes altRoute and fails because the reversed array is not in route order, so that Selector falls through to its different route branch.

params slot. Comparison reads the method’s bool, so true continues the branch and false sends the Selector to its next child.How it decides
Section titled “How it decides”Result
- Success
- The method returned, and on a method node its Result mapping or a Comparison on a condition held. An empty Individual values list is a successful call with an empty array.
- Failure
- The Comparison did not hold, the Result mapping said so, or the target did not resolve this evaluation. A method that throws is a recorded fault, never an authored Failure.
- Running
- Only when the method itself returns a coroutine or awaitable; see waiting and cancellation. The packing of values never waits.
The slot
- Exactly one slot, for the declaration’s trailing
paramsparameter. Ordinary parameters ahead of it keep their ordinary rows, andref,out, and optional parameters on the same signature keep their own cards. - The header reads the parameter name, the element type, and
params. The switch offers Individual values and Collection. There is no Default for aparamsparameter. - The slot appears on method nodes and member condition nodes alike, with the same forms, the same rows, and the same validation words.
Individual values
- One row per value, in call order. A row’s source is C (a typed constant) or BB (a compatible Blackboard variable). Element types stay exact; a CLR-safe reference upcast is also available, such as an
int[]orList<int>supplied as oneobjectinparams object[]. This passes the collection as one element, not its contents. Project is not offered on a params row. - Add value appends a row. Remove value deletes exactly that row. The grip reorders by pointer drag or with Alt+Up and Alt+Down; a reorder is one undo step.
- A row with no value reads Required. A constant the element type cannot represent reads Incompatible with the reason, names
parameter[index], and blocks Save, bake, and graph start. The Validation card offers Remove value for that exact row. - Zero rows is valid and calls the method with an empty array.
Collection
- One field, Blackboard only, holding an array of the element type or a
List<T>of the element type. The picker rules out everything else with its reason. - A saved collection that no longer resolves reads Missing; one whose type no longer fits reads Incompatible. Both keep the saved name so you can see what it was.
- A managed-companion array is passed directly. A managed-companion list is copied into one cached array that is reallocated only when the list’s count changes, so unchanged-size conversion reuses its allocation. Native-backed arrays use a fresh exact-sized snapshot for each call, and native-backed lists convert straight from their buffer into an exact-sized array without an intermediate list. Those native snapshots allocate even when the count is unchanged.
Switching and saving
- The switch is one edit and one undo step. The inactive payload is retained, shown as a note, and never validated while inactive: a bad constant in a retained row does not block a Collection call.
- The graph file records the active form, each individual value’s source and position, and the collection’s name, in source format
bitquirky.behavior/1.8. A reopen restores both payloads and the active form exactly as authored. See graph files. - The canvas card lists the Blackboard values the active form reads, each row’s variable in order or the one collection, so the route is readable without opening the rail. The exact index of a faulty row lives on the rail and in the Validation card.
At runtime
- The generated provider allocates the outer Individual values array once when the graph starts and refills it on every call. That packed outer array is reused; this does not make every source read allocation-free. A native array supplied as one element materializes a fresh snapshot, shared with other reads of that same native array during the call. A native list uses its existing typed source materializer and commits supported element mutations within the authored capacity after a normal return.
- The entity path refuses a
paramsparameter, naming the modifier. Bind it on a GameObject agent. - An indexed property with a trailing
paramsindex parameter is a different case: it gets one required row holding a single array value, never this multi-row slot. See indexed property.
When it goes wrong
Section titled “When it goes wrong”When it goes wrong
| Symptom | Check | Fix |
|---|---|---|
| The method is in the picker but the Arguments card has no Add value button. | Read the switch. It is on Collection, which shows one field instead of rows. | Click Individual values. Any rows you authored before are still there. |
| The variable I want is struck through on a row. | A row takes one element. An array or list variable is ruled out with that reason. | Switch the slot to Collection for an array or list, or pick a variable of the element type for the row. |
| Save is refused with one binding issue. | Open the Validation card. It names the parameter and the index, waypoints[0], and the constant that does not reach the element type. | Give that row a value of the element type, or click Remove value on the finding. |
| The enemy visits the waypoints in the wrong order. | The rows are the order. Read them top to bottom on the rail, or the array variable in Live. | Drag the rows by their grips, or Alt+Up and Alt+Down with a grip focused. |
| I switched to Collection and my rows vanished. | They are retained. The note under the field counts them. | Click Individual values and they return in their order. Undo also reverses the switch in one step. |
| The entity picker refuses the method. | The refusal names params. The Burst path admits only unmanaged by-value and ref parameters. | Bind it on the GameObject path, or offer a fixed-arity static overload for entities. |
| The call runs but the method sees an empty array. | Zero rows is a legal call. Select the node: the Arguments card reads 0 values. | Add the values, or switch to a Collection that is filled before the graph ticks. |
- Arguments and results: the sources every other parameter row takes, and the Result card.
- Condition and event: the member condition this page’s decision is built on.
- Platformer: Enemy Params in its own scene, with the two route decisions already authored.
- Member nodes and bindings: the field list for the Arguments card.