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 a C# feature.

Browse the reference instead

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

v1.0.0
Menu

Get and set

Read values with GET pills and change them with SET nodes placed and wired on the canvas.

Reading a value and changing a value look different on the canvas. A read is a small rounded pill that sits beside the node using it. A write is a navy SET node on the white wire.

A GET pill brings a value onto the canvas: a variable of this class, a parameter, a local, a value on another object, or a static value such as a constant. It has no white pins, so it never takes a place in the running order; the value is read when a node uses it. Its color is the value’s type color, and its wire carries that color to every pin it feeds.

A SET node stores a new value. It sits on the white wire, so it runs at a definite moment, and the new value arrives on its Value pin. Because every change is a node on the white wire, following that wire shows you every place the method changes something.

Use a GET pill whenever a node needs a value that already exists: the coin count for a HUD call, the player’s speed for a movement node, the enemy’s health for a comparison. Use a SET node when the game should remember something new: add to the score, mark a coin as collected, store the player’s new velocity, flag a door as open.

Some values can be read and not written. A property that only hands out a value has no SET route, and its rows show set grayed out with the reason Read only. Properties normally belong in Variables. A property that calculates an answer or runs behavior in an accessor appears under Methods instead; merely having get and set does not move it there. Properties: Variables or Methods? explains the distinction with GameMaster screenshots and small code examples.

A local whose type row in the type chooser is var takes its type from the first SET that fills it. Every GET and SET node for that local then shows the type that first SET gave it. A field never offers var.

Read and write values

  1. Open a method

    Open a method canvas with at least one node on the white wire, such as the magenta entry node of a new method.

    A new method's magenta entry node on the canvas.
  2. Drag a variable

    Drag a row, such as _coins, from the Variables list in the left rail onto empty canvas. A small menu opens with get and set rows named after the variable, for example get _coins and set _coins.

    Clip: drag the _coins row from Variables to the canvas and open its get and set choices. The _coins row in the Variables list is highlighted while it is dragged, then the get choice is highlighted once the menu opens.
  3. Choose get

    Click get. A rounded pill appears with one output pin on its right.

    The green _coins GET pill with its output pin on the right, highlighted with an arrow pointing at it.
  4. Place a SET

    Drag a second copy of the same row onto the canvas and click set. A navy SET node appears.

    Clip: drag _coins onto the canvas again and choose set. The _coins row in the Variables list is highlighted while it is dragged, then the set choice is highlighted once the menu opens.
  5. Connect the execution wire

    Drag from the last node on the white wire (its Exec pin on the right) to the SET node’s left Exec pin. A white wire joins them.

    Clip: connect the entry node's execution output to the SET node. The entry node's Exec pin and the SET node's Exec input are highlighted.
  6. Supply the value

    Give the SET its new value. Drag a colored wire into Value from a pill, a parameter pin on the entry node, or another node’s result. Or click the empty area beside Value and type a literal such as 0.

    Clip: connect the _coins GET pill to the SET node's Value input. The SET node's Value pin is highlighted.
  7. Read an object's member

    To read a value on another object, drag that object’s pill output pin onto empty canvas. In the menu of its members that opens, pick a member (here, _hud offers transform.position.x), then click get for a pill wired from the object, or set for a SET node whose Target pin is already wired to it.

    Clip: drag an object pill's output onto the canvas and choose a nested member from the filtered menu. The _hud pill is highlighted.
  8. Walk from the Variables rail

    Drag a variable that holds an object, such as _hud, from the Variables list. The menu asks one level at a time: pick a member, then the next, using back to to step out, and click get or set when you reach the value you want. The clip walks _hud through transform, position, and x.

    Clip: drag an object variable and walk through its members one level at a time to choose a read. The _hud row in the Variables list is highlighted.
  9. Find a static value

    For a static value, such as a constant declared on another class, right-click empty canvas and type its name. Read a static value walks through it.

    Clip: right-click empty canvas and search for a static LevelRules value. Once All actions opens, its Search box is highlighted.
  10. Give the write a useful value and compile

    To copy the threshold into the count instead of writing _coins back to itself, drag _coinsToUnlock from Variables, choose get, and wire its output into the _coins SET’s Value. Then press Compile in the toolbar.

    Clip: drag _coinsToUnlock from Variables, choose get, wire it to the _coins SET and press Compile; the saved graph reopens. In turn, the _coinsToUnlock row, the get choice, the new pill's output and the SET node's Value pin, and finally the Compile button are highlighted.

You can also place both from the action menu. Right-click empty canvas and the variables and local variables groups list every value with get, set, and name of buttons. Or right-click a row in the Variables list and choose Create Get Node or Create Set Node. name of places a GET pill wired into a small node that produces the variable’s name as text, for a message or a log line.

The AddCoins diagram showing compound assignments
Figure 1. A finished read-and-write to compare with: the green Coins and Score pills feed green ADD nodes, and each result wires into the Value pin of a navy Coins SET or Score SET node on the white wire.

A static value belongs to a type instead of an object: a constant such as LevelRules.DefaultMoveSpeed, a static readonly field, or a static property such as Keyboard.current or Time.time. No variable of this class holds it, so it is not in the Variables list.

DefaultCoinUnlockThreshold, labeled LevelRules, feeds the message pin of a dark teal Log call card.
Figure 2. Check the connected read. The constant has LevelRules above its title and no input pin: it belongs to a type, not an object. Its output feeds message. Compile writes Debug.Log(LevelRules.DefaultCoinUnlockThreshold);.

Read a static value

  1. Open the action menu

    Right-click empty canvas.

    The All actions menu open on empty canvas under the entry node and the SET node.
  2. Search for a value

    Type at least three letters of the member’s name, the type’s name, or both with a dot between, such as DefaultMove, LevelRules or LevelRules.Default.

    All actions filtered to LevelRules.Default with matching static values. The Search box is highlighted.
  3. Choose the row

    Click the row. A GET pill appears where you right-clicked.

    All actions filtered to LevelRules.Default. The LevelRules.DefaultCoinUnlockThreshold row is highlighted.
    The LevelRules.DefaultCoinUnlockThreshold GET pill on the canvas, highlighted, with an arrow pointing at it.
  4. Use the value

    Drag from the pill’s output pin into the pin that uses the value, such as a call’s argument.

    Clip: wire the LevelRules constant pill into a SET node's Value pin. The SET node's Value pin is highlighted.
  5. Compile the read

    Press Compile in the toolbar.

    The whole Graph view with the LevelRules.DefaultCoinUnlockThreshold pill wired into the SET node's Value pin. The Compile button at the left of the top rail is amber and highlighted, with an arrow pointing at it.

Start from the right-click: dragging a node’s input pin onto empty canvas places nothing. A placed pill keeps its spot when you switch methods or Unity reloads, wired or not.

Compile writes the pill inside the node it feeds, as the type’s name and the member’s name joined by a dot. When the script already has a using line for the type’s namespace, the short type name is enough; otherwise the type is written with its namespace. Compile never adds a using line. Door in the Platformer reads the keyboard this way: its Update method opens with var keyboard = Keyboard.current;.

If you also work in C#, this is what is written into the script. These lines sit in a short ShowPickup helper on PlayerController in the Platformer sample. The first line is the HUD call from CollectCoin. The other lines are short illustrations: a member SET, a name of node, and a var local filled by its first SET, here from the sample’s GetVelocity() helper.

A pill is never a line of its own. It is written inside whatever node it feeds.

When it goes wrong

SymptomCheckFix
The set button is grayed out with read onlySelect the variable and read its Declaration and Storage cards in the right rail: it may be a property with no setter or a field that cannot be changed. Inside a static method, a variable of the object itself cannot be written either.Choose a value that can be written, or the variable that stores it.
The member menu stops offering deeper membersCount the steps in the walk: it goes four members deep.Pick get or set at the current step.
A static value shows a type you did not expectRead the type name before the dot on the static value's row, and the namespace on the line under it.Pick the row whose type and namespace are the ones you want.
No static value appears in the listCount the letters in search: static values are searched from three. A last row reading building index means the project is still being read, and no source file means the class has no script to search from.Type more of the name, wait for building index to clear, or open a class backed by a script.
The list ends with showing … of many; keep typing to narrowThe search reads at most 200 matching static values and shows the best forty rows, so the value you want may be past the end.Type more of the name, or add the type and a dot, such as LevelRules.Default.
A static value you can see in C# is missingThe menu lists the static fields and properties this class can read. A private member of another class is not listed. An obsolete member is listed after every other match, and one hidden from IntelliSense only when Show hidden members is on in Preferences.Make the member reachable from this class, or type more of its name.
Full-size image