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

Pills and literals

Feed a node's pins from compact GET pills, typed values, composite values, and object references, and split a shared pill.

Most values a node needs already exist somewhere: a variable on this component, a reference to another object, an input the method was given, a value worked out a few nodes earlier. A pill is the small rounded node that brings one of those values onto the canvas. A literal is a value you type straight onto the pin that uses it, because it exists nowhere else.

A behavior is mostly values flowing into nodes: the health of the thing that was hit, the audio player to make a sound with, the list a loop walks, the number of retries allowed. Drawing each of those as a full node would bury the three or four nodes that matter. Fixed values have the same problem: a 0, a tick box, a name or a sound asset does not deserve a node of its own, but it still has to be visible and editable where it is used.

So a read becomes a pill, colored by its value’s type, with one dot on its right that you wire from. A fixed value becomes a box beside an unwired input pin. One pill can feed several pins at once, and you can split it so each pin gets its own pill.

Use a pill when the value already exists and the node should follow it: a variable or property on this component, a member of another object the component holds, a method input, a local, or the component itself. When the value changes in the game, the pill reads the new value.

Use a literal for a value that belongs at this one use: a jump threshold, a flag, a tag or layer name, a message, an offset, a choice from a list such as a state. If several nodes share the same value, or a designer should tune it in the Inspector, make it a variable and read it with a pill instead.

Use the object picker on the pin for a Unity object, such as a prefab, a material or a sound. The picker remembers which asset you chose, so renaming the asset later does not break the link.

A value read off another value stays one pill, however many steps it takes, such as the y of the transform’s position. The small label above the pill names the steps it passes through.

A pill takes the color of its value and can feed several pins. When the canvas lays out a method that reads the same value in several places, it draws one pill for the uses that sit close together and wires it to each of them. Uses far across a wide diagram get a pill of their own beside them, so no wire has to cross the whole canvas. That happens on the first open of a method with no saved layout and each time you press Auto layout; Split long read wires and Split distance, under READ PILLS in Preferences > Round Trip, decide how far apart is far. A literal sits on an unwired input row. A hollow pin means the input has no wire and no value yet.

An unwired bool input draws a checkbox instead of a box to type into. A tick is true and an empty box is false. A short gray dash means no value has been given yet, so the call cannot be written until you wire one or click the box, and the first click sets true. To take the value away again, right-click the box and choose Clear: the dash comes back.

An input that accepts any value, such as the message pin of a Log call, wears the color of whatever arrives: the color of the wire plugged into it, or of the value typed into it. Only the color follows. What you can plug in, which box appears, and what Compile saves stay the same.

Edit a literal without replacing the pill

Select a screenshot to enlarge it.

AwardPickup calls AddCoins with a purple _scoreCounter pill wired into target and the literal 1 beside count.
Figure 1. Find the unwired input In this AwardPickup example, target reads an existing object through a pill. The green count input has no wire: its value is typed directly beside the pin.
The same AwardPickup diagram with count changed to 2 while the _scoreCounter target wire remains.
Figure 2. Change just the count The count field now reads 2. The purple target wire and white exec wire are unchanged. Use Compile to write a value edit into the script.

Round Trip reads what you type as you type it and checks it against the pin. On an input that accepts any value, the value itself decides the type, so the box takes that type’s color as soon as it makes sense: text in double quotes is string pink, a whole number is int green, and true or false is bool red. A word without quotes is not text. In C# it would be the name of something, so the box turns coral and a hint hangs below it while you are still typing. Add the quotes and the hint goes away.

Type a value onto a pin that takes any object

Select a screenshot to enlarge it.

A TypedLiteralsDemo entry node wired to a dark teal Log card. The literal editor is open and empty beside the purple message pin.
Figure 3. Open the box Click the box beside Log’s message pin. It opens empty, outlined in object purple, because the pin takes any value.
The same Log card with "hello", in quotes, in a pink box beside a pink message pin.
Figure 4. Quoted text is a string Type "hello" with the double quotes and press Enter. The box and the pin turn string pink.
The literal editor holds hello without quotes inside a coral box. Below it a coral hint reads: "hello" is not a valid Object value. Text must be quoted: try "hello".
Figure 5. An unquoted word is refused Without the quotes the box turns coral while you type, and the hint below it shows the fix: "hello" isn’t a valid Object value. Text must be quoted: try "hello".
The Log card with 5 in a green box beside a green message pin.
Figure 6. A number is a number Type 5 and the box and pin turn int green. No quotes: it is the number, not the text.
The Log card with true in a red box beside a red message pin.
Figure 7. true and false are bools Type true and they turn bool red.
The entry node wired through three Log cards in a row. Their message boxes hold true in red, "hello" in pink and 5 in green.
Figure 8. Each use keeps its own type Three Log calls side by side, each with a different kind of value on the same kind of pin. Only the color follows the value: every message pin still accepts anything.

A pin with a fixed type checks the value against that type instead. A string pin asks for the quotes with String values must be quoted: try “…”. A float pin adds the f that C# needs on a decimal float: type 1.5 and the box reads 1.5f when you press Enter.

An Assert AreApproximatelyEqual call card whose expected and actual float pins both hold 1.5f in green boxes.
Figure 9. 1.5 typed on both float pins of Assert.AreApproximatelyEqual is committed as 1.5f, and Compile writes Assert.AreApproximatelyEqual(1.5f, 1.5f);.

Every value you can type or pick beside a pin can be taken back to empty. Right-click the value, or the pin it sits beside, and choose Clear. It works the same on a checkbox, a typed number or text, a choice from a list, a box split into parts such as a Vector3, and an object chosen with the picker. Clear is dimmed when there is nothing to clear.

A value the script already passes to a call is sometimes required: C# cannot write that call without it. Clear refuses there and explains why, instead of leaving a call that can no longer be written. A value on a node you placed yourself, which is not in the script yet, can always be cleared. So can a value you typed into a pin after deleting the wire that fed it: the script never held that value, so Clear puts the pin back to no value and the node’s Node not completely wired message returns until you give the pin a value again.

Clear a checkbox back to no value

Select a screenshot to enlarge it.

Two IsTrue nodes on the CheckReady canvas. The top one, already in the script, has a ticked condition box. The bottom one was just placed and wired after it; its condition box, highlighted with an arrow pointing at it, shows a short gray dash, and its condition pin is hollow.
Figure 10. A placed node starts with no value The lower IsTrue was just placed from the top node’s exec pin. Its condition has no value yet: a dash in the box and a hollow pin.
The lower IsTrue node’s condition box is now ticked, highlighted with an arrow pointing at it, and its condition pin is solid red.
Figure 11. Click the box The first click ticks the box, so condition is true, and the pin turns solid.
The lower IsTrue node’s ticked condition box with a context menu open just under it. The menu’s one row, Clear, is highlighted.
Figure 12. Right-click the box and choose Clear Right-click the value, or the pin beside it. The menu offers Clear.
The lower IsTrue node is back to a gray dash in its condition box, highlighted with an arrow pointing at it, and a hollow condition pin.
Figure 13. The dash comes back After Clear, condition has no value again. The node still cannot be written until you give it one.
Under the top IsTrue node’s ticked condition box, a coral message, highlighted with an arrow pointing at it, reads: This value is required, so it can’t be cleared. Wire a value into this pin to replace it.
Figure 14. A value the script needs stays Clear on the top node, which the script already calls, is refused. The box stays ticked and a message explains why.

The refusal reads This value is required, so it can’t be cleared. Wire a value into this pin to replace it. Under a checkbox or a choice from a list it shows for four seconds, or until you set a value. On a typed value the editor opens empty with the message below it: type a new value and press Enter, or press Escape to keep the old one.

A pill can feed more than one node. Right-click one of its wires for Split pill, then right-click the new pill’s wire for Recombine pill. You can also right-click the shared pill and choose Split pins to give each wire its own pill.

Or hold Cmd (Ctrl on Windows/Linux) over the pill end of a wire and drag: the new pill lands where you let go.

The captures use the Platformer scene and PlayerController. The canvas is framed for clarity; pointers and click markers in clips are site overlays.

Feed a call with values

  1. Add a Log call

    In the left rail, click + on the Methods header and press Enter. A magenta entry node appears. Drag from its white Exec pin onto empty canvas to its right and let go. Search for Debug.Log and choose Log(object message). A dark teal call card titled Log appears, already wired from the entry node.

    Add a method with the + button beside Methods, highlighted with an arrow pointing at it, then drag its execution pin onto empty canvas to choose Debug.Log.
  2. Enter a literal

    Look at the Log node’s message pin: it is hollow, with an empty box beside it, both object purple, because the pin takes any value. Click the box and type "Coin collected", quotes included, then press Enter.

    Enter quoted text in Log's message box, which is highlighted with an arrow pointing at it, then remove the quotes to show its invalid-value hint.
  3. Read an existing value

    Right-click empty canvas to the left of the Log node. In the VARIABLES section of the menu, click get on a variable row, such as gameObject. A purple pill labeled gameObject appears. Drag from the dot on its right end to the message pin. A purple wire appears and the pin turns purple.

    Choose gameObject from the canvas menu with its get button highlighted, then wire the pill's dot, highlighted, into Log's message pin, also highlighted. Each has an arrow pointing at it while it is in use.
  4. Break the wire

    Alt-click (Option-click on macOS) the purple wire. It breaks, and the message box comes back, ready for a typed value again.

    The gameObject pill is disconnected and the empty message box has returned beside Log, highlighted with an arrow pointing at it.
  5. Share one pill

    Place a second Log call to the right of the first and drag a white wire from the first node’s Exec output to its Exec input. Reconnect the gameObject pill to the first Log node’s message pin, then drag from the same pill’s dot to the second node’s message pin. One pill now carries two purple wires.

    Place a second Log on the execution path and connect the gameObject pill to both message pins. The first Log's Exec output, the second Log's Exec input, the pill and each message pin are highlighted with an arrow in turn as they are used.

Split and recombine a pill

  1. Split the pill

    Right-click the shared gameObject pill and choose Split pins. A second pill appears, and each pill now carries one wire. To fold the two back into one, right-click a split pill’s wire and choose Recombine pill.

    To split just one wire instead, hover it and right-click Split pill. A wire that runs straight from a method input on the entry node, or from a local, can be split and recombined the same way.

    Use Split pins on the shared gameObject pill, then Recombine pill on a split wire. The pill, the Split pins menu item and the Recombine pill menu item are highlighted in turn, the first two with an arrow pointing at them.

Drag a wire to split

  1. Drag a wire to split

    Once the wires share one pill again, hold Cmd (Ctrl on Windows/Linux) over the pill end of one wire. DRAG TO SPLIT PILL appears. Drag that end to an empty spot and let go.

    Hold Control and drag one wire away from the shared gameObject pill, highlighted with an arrow pointing at it, placing a new pill at the release point.

Enter a composite value

  1. Enter a Vector3

    For a separate composite example, place AudioSource.PlayClipAtPoint(AudioClip clip, Vector3 position). Its position input has one box per axis: enter 1 in X, 2 in Y and 3 in Z.

    Enter the position components of PlayClipAtPoint in its three axis boxes, which are highlighted with an arrow pointing at them.

Choose and clear values

  1. Choose an asset

    Click Select asset beside the clip pin to open the Unity object picker. Search for sfx_coin and select the sample sound; its name appears in the box. To find the asset in Unity’s Project window, click the Reveal in the Project window. icon at the end of the box, or Alt-click (Option-click on macOS) the pin label.

    Reveal the selected asset

    Select a screenshot to enlarge it.

    The Project window shows the Sounds folder and highlights sfx_coin.
    Figure 15. Find it in Project Reveal opens the containing folder and highlights the sound you selected.
    The AudioClip picker is filtered to sfx_coin and shows the matching sample sound. The Select asset box beside the clip pin, with an arrow pointing at it, and the sfx_coin row are highlighted.
  2. Clear a value

    To take a value back to empty, right-click it, or the pin beside it, and choose Clear. A checkbox shows the gray dash again and a typed box empties.

    A required value stays set

    Select a screenshot to enlarge it.

    The required isGoalUnlocked value stays checked and shows why Clear was refused.
    Figure 16. Clear is refused The committed argument stays true; wire a replacement instead.
    PlayClipAtPoint shows an empty position row and no selected clip after Clear, with the emptied clip and position boxes highlighted and an arrow pointing at them.

Write the connected example

  1. Compile the example

    Return to the two-Log example, with a value or wire on each required message input, and press Compile in the toolbar at the top of the Graph view.

    The whole Graph view before Compile: NewMethod runs two Log calls, both fed by the shared gameObject pill. The Compile button in the toolbar at the top is highlighted with an arrow pointing at it.

If you also work in C#, this is how a call fed by pills and one typed value appears in the script. This one is drafted on AudioCuePlayer in the Platformer sample:

_coinClip is a variable holding an asset chosen with the object picker, transform.position is a read passed through transform, and 0.8f is a value typed on the volume pin. A wired pin writes whatever the wire carries. An unwired pin writes the value typed on it. Splitting or recombining pills changes the drawing only; the script reads each value exactly as often as it did.

Typed values on a pin that takes any object are written as you typed them, so their type in C# is the type you saw on the canvas. This is TypedLiteralsDemo from the pictures above, compiled:

When it goes wrong

SymptomCheckFix
The box beside a pin is missing.Look for a wire entering the pin, or a pin type that takes no typed value.Alt-click the wire to break it and the box returns, or wire a pill of the matching color into the pin.
Split pins is dimmed and reads needs two or more wires.Count the wires leaving the pill.Splitting needs a pill with two or more wires. Wire it into another pin, or leave it as it is.
The box beside a pin turns coral while I type.Read the hint below the box. On a pin that takes any object, a word without double quotes is not text.Put the text in double quotes, such as "hello", or type a number, true or false.
The object picker shows no matches.Read the pin type, and the type of the asset you expect.Choose an asset that fits the pin, or leave the box empty until the asset exists.
Clear is refused: This value is required, so it can't be cleared.The node is already in the script, and C# cannot write its call without this value. A value you set after deleting the pin's wire is not refused: Clear returns that pin to no value.Type or pick a different value, or wire a pill or another node's output into the pin. To remove the call, delete the node.
Clear is dimmed.Look at the value. An empty box, a dash in a checkbox or an empty object box has nothing to clear.Nothing to do. Clear lights up again once the pin has a value.
Full-size image