Skip to content
Bit Quirky Round Trip
Visual Scripting

Search documentation

All topics and APIs

Close returns focus to Search.

What are you looking for?

Try a common topic or enter a complete API identifier.

Browse the reference instead

Esc closes · Tab reaches results · Enter opens the focused link

v0.89.0
Menu

Arrays, tuples, and ranges

Construct collections and grouped values, index them, slice them, and take tuples apart.

A patrol can keep points in an array, a contact scan can read one element, and a helper can return two related values as a tuple. These shapes keep several values together without hiding how they are used.

Collection code has details that matter. matrix[row, column] is not the same shape as matrix[row][column]. ^1 counts from the end. A tuple element may be read by a written name or by Item1.

Use an array construction when you need a fixed sequence of values. Use a struct construction when a value type has named constructor arguments. Use an indexer to read or write an element. Use a range and slice to select a span. Use a tuple to carry several results without declaring a new type, and deconstruct it when each element needs a local name.

To give a field or local an array type, open its type row in the Variables rail. array sits at the top of the type chooser, after var for a local. Choosing it reopens the chooser to ask what the array holds, so the row becomes int[] or Vector2[]. An array of arrays is not offered this way.

The canvas presents each element or constructor argument as a pin. Index, range, from-end, slice, Make Tuple, and Break Tuple nodes keep their own shape when source is parsed back.

  1. Right-click empty canvas and choose the array, struct, Make Tuple, or Break Tuple action you need.
  2. For a new array, fill an element slot. Its type settles the array’s element type. Add, remove, or reorder slots to change the collection shape.
  3. For a struct, choose its type and constructor, then fill the argument pins.
  4. Place an element access and connect the collection plus its index. Choose add index to create another operand for a multi-dimensional access.
  5. Use a from-end index for positions such as the last element. The operand remains significant even when it is zero.
  6. Build a range with a start, an end, or deliberately open ends, then connect it to a slice.
  7. A Make Tuple starts with two slots. Fill both, then choose add pin for another. A named tuple and unnamed tuple with the same ordered element types can connect.
  8. Connect a tuple to Break Tuple to create a deconstruction. The resulting locals follow the tuple names where available.
  9. Press Compile in the toolbar, then inspect the re-parsed nodes. Author-written array and tuple spellings are retained when their recorded shape has not changed.

When it goes wrong

SymptomCheckFix
The array stays wildcard grayCheck whether any slot has a typed value or wire.Supply the first element so the array type can settle.
Compile leaves an access unfinishedLook for a missing collection, index, range, or assignment value.Fill every required pin or remove the unfinished node.
A nested deconstruction refusesLook for a tuple pattern inside another tuple pattern.Finish that edit in C#; the parser flattens that shape.
Full-size image