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

Build it visually, then Compile

Wire a value into a node on the canvas, swap it back to a typed value, preview the draft, and Compile one focused change.

Change one input on the canvas and watch the script change only when you ask it to. You will feed a Log node’s message from a wire, see how a wired pin behaves, put a typed value back, and Compile the result. This is the shortest tutorial, so it is a good first one: every step names the click. Your first class comes next and builds a whole behavior from an empty class.

Every word in this table is something you will see on screen. Skim it now and come back when a step uses a word you have forgotten. The pictures come from Your first class, so they show its Movement class; here you build CoinAnnouncer.

Words used in this tutorial

WordWhat it looks likeWhat it means
ClassThe class chip at the top left of the Graph view, reading Movement.A named bundle of settings and actions, saved as one C# file. Here the class is CoinAnnouncer, and its name sits in the chip at the top left.
MethodThe Lifecycle list on the left of the Graph view, listing three methods.One named list of actions, such as AnnounceCoin or Start. The Methods and Lifecycle lists on the left show them; Unity runs a lifecycle method such as Start for you.
NodeThe teal Translate node, a box with pins down its left edge.A box on the canvas. Each node is one action or one fact: start here, log this, call that.
PinThe three input pins on the left edge of the Translate node: a white Exec arrow and two dots.A dot on a node's edge. A pin on the left takes something in, and a pin on the right hands something out. Wires connect pins, and an unwired pin can hold a typed value instead, such as the message on Log.
Exec wireA white wire running from the Exec arrow of the OnMove node, on the left, to the Exec arrow of the move node, on the right.A white wire that sets the order things happen in. It runs from an Exec arrow to the next node's Exec arrow.
Data wireThe direction pill with a pink wire running to the first input of the Multiply node.A colored wire that carries a value from one pin to another. In this tutorial a pink wire carries a name, which is text, into the Log node's message.
PillThe small rounded green speed pill.A small rounded node that only reads a value, such as the GameObject's name. It has no Exec arrow, because it does not do anything.
CompileThe gold Compile button in the toolbar.The gold button that writes your canvas into the C# file. Nothing in the script changes until you press it.

This page works on a small component called CoinAnnouncer with one method, AnnounceCoin, that logs a message. Build it in a practice project in a couple of minutes. Steps 1 to 5 below are that setup; steps 6 to 12 change the message.

Build the practice component

  1. Create the class

    In Tools > Round Trip > Graph view, press the + beside the class chip, name the class CoinAnnouncer, choose MonoBehaviour and press Create.

    Clip: in the Graph view, the plus beside the class chip, highlighted with an arrow below it, opens Create new class. CoinAnnouncer is typed as the name, the MonoBehaviour card is chosen and Create is pressed.
  2. Add the method

    Press + on Methods, type AnnounceCoin and press Enter.

    Clip: the plus on the Methods header, highlighted with an arrow beside it, adds a row in edit mode, AnnounceCoin is typed and committed, and an AnnounceCoin entry node appears on the empty canvas.
  3. Log a message

    Right-click the canvas and pick Log under logging. Wire the entry node’s white Exec pin into it. Click its message pin and type "Hello from Round Trip", quotes included, then press Enter. Press Compile so the script holds the new method.

    Clip: right-clicking the empty canvas opens All actions, Log is typed and chosen, the entry node's Exec pin is wired to the Log card, and the message pin takes the quoted text Hello from Round Trip. While the pointer rests on the entry node's Exec pin to drag from, it is highlighted with an arrow pointing at it. After Compile the canvas reloads from the saved script with the text beside the message pin.
    The whole Graph view of an example class, with the toolbar Compile button highlighted and an arrow pointing at it. Compile is amber because the canvas holds a change that is not in the C# file yet.
  4. Call it from Start

    Press + on Lifecycle and choose Start(). Right-click its canvas and type AnnounceCoin, then click the row that appears. Wire Start’s Exec into the new node and press Compile.

    Clip: the plus on Lifecycle, highlighted with an arrow, opens the Add lifecycle method list and the Start row is highlighted and chosen. A right-click on the Start canvas searches AnnounceCoin and places its call, the white Exec wire joins Start to it, and the toolbar Compile button is highlighted when it is pressed. Compile reloads the canvas with the Start event marked as a lifecycle node.
  5. Add it to a GameObject

    Add CoinAnnouncer to any GameObject with Add Component. When you press Play, the Console shows Hello from Round Trip.

    Clip: an empty GameObject is selected, Add Component opens its search, CoinAnnouncer is typed and chosen, the component appears in the Inspector, and the Console shows Hello from Round Trip once Play starts.

The Log node in AnnounceCoin prints a message you typed. You want it to print the name of the GameObject the component sits on, so each announcer says which coin it belongs to. That means replacing a typed value with a wire, and knowing how to go back.

  • You want to try a different value on a node without rebuilding the method.
  • A node already exists and only one of its inputs should change.
  • You want a draft you can undo before it touches the script.
What happens when Compile writes a visual draftFour stations show a draft in memory moving through Compile, one changed C# line, and a diagram rebuilt from source. A token visits each station. A side path shows that a placeholder node is refused and leaves the file unchanged. The final frame holds the token at Re-parse and reports that the source is unchanged except for one line.1Draft(memory)2Compilecheck the draft3Smallest editto the .cs- AddCoins(1) + AddCoins(2)4Re-parseview from sourceplaceholder noderefuses, file unchangedsource unchanged except one lineWhat happens when Compile writes a visual draftFour stations show a draft in memory moving through Compile, one changed C# line, and a diagram rebuilt from source. A token visits each station. A side path shows that a placeholder node is refused and leaves the file unchanged. The final frame holds the token at Re-parse and reports that the source is unchanged except for one line.1Draft(memory)2Compilecheck the draft3Smallest editto the .cs- AddCoins(1) + AddCoins(2)4Re-parseview from sourceplaceholder noderefuses, file unchangedsource unchanged except one line
A canvas edit stays in the draft, Compile saves it into the script, and the canvas then reloads from that script.

Replace the typed message with a wire

  1. Open the method

    Open Tools > Round Trip > Graph view. Open the class picker by pressing the class chip at the top left (Cmd/Ctrl+O does the same), choose CoinAnnouncer, then select AnnounceCoin in the Methods section of the left rail. The canvas shows the magenta entry node wired to your Log node, with your text in its message box.

    Clip: the Unity Tools menu opens, Round Trip opens its submenu and Graph view is chosen, each menu item highlighted in turn. In the window the class picker opens, the Runtime scope is chosen, CoinAnnouncer is selected, and AnnounceCoin is clicked in the Methods section.
    The whole Graph view with the class chip at the top left, showing CoinAnnouncer, highlighted and the AnnounceCoin row in the Methods section of the left rail highlighted, each with its own ring.
  2. Place the name value

    Right-click blank canvas and press get on the name row under VARIABLES. If the class has many variables, type name in the search box first; the name row stays at the top of the list. A pink pill labeled name appears. Pink is the color of text values.

    Clip: right-clicking blank canvas opens All actions with the VARIABLES list. The search box takes name and the name row appears first with its three buttons. Pressing get places a pink pill labeled name.
  3. Wire it into message

    Drag from the pill’s output pin onto the Log node’s message pin. A pink wire joins them.

    Clip: a drag starts on the name pill's output pin, highlighted with an arrow while the pointer rests on it, and ends on the Log node's message pin. A pink wire joins them and the typed text box on message is gone.
    The full window after the wire, with the Previewing your changes panel at the top of the right rail highlighted with an arrow, and the amber toolbar Compile button highlighted with an arrow below it. The panel reads 2 nodes aren't in the C# yet and offers Revert and Compile. On the canvas the AnnounceCoin entry node wires white into Log, and a pink wire runs from the name pill to message.

Compile and run it, then go back to typed text

  1. Compile

    Press Compile in the toolbar.

    The full window after Compile and reload, with the toolbar Compile button highlighted and an arrow below it. Compile is gray, the Previewing your changes panel is gone, and the canvas still shows the pink wire from the name pill into the Log node's message pin.
  2. Press Play

    Press Play. The Console now shows the name of each GameObject that carries a CoinAnnouncer.

    The Unity Console after the Play run lists one plain information message for each GameObject that carries a CoinAnnouncer: CoinBeta and CoinAlpha. The information counter reads 2, and the warning and error counters read 0.
  3. Break the wire

    Go back to a typed message. Stop Play, then hold Alt and click the pink wire. The wire disappears and message is unwired again.

    Clip: the Unity toolbar shows Play Mode running, then stopped. With Alt held, a click on the pink wire removes it. The message pin is unwired again and the name pill stays beside the canvas.
  4. Type the message again

    Click the empty message pin. Its text box opens; type "A coin is ready", quotes included, and press Enter or click away. The box and the pin turn pink, the color of text. Press Compile, and the canvas reloads showing the typed text on the pin.

    Clip: clicking the empty message pin opens its text box and the quoted text A coin is ready is typed. The box and pin turn pink. The toolbar Compile button is highlighted when it is pressed, and the canvas then reloads with the typed text on the pin and no name pill.

If you also work in C#, after step 9 the call in CoinAnnouncer.cs reads:

After step 12 the same line carries your typed text again. Only that one argument changes each time; the rest of the method stays as it was.

Before Compile, press Cmd/Ctrl+Z. Each press steps one edit back through the draft, newest first: in steps 11 and 12, the typed text goes first, then the broken wire comes back. The script is untouched while you do this. To discard the pending C# edits and restore the diagram from the current source file, use Revert on the Previewing your changes. panel instead.

After Compile, Undo cannot take the change back: the change is in the script file, and saving it clears the undo history. To go back, change the canvas again and press Compile, or restore the file from your last commit (Protect your game files shows how).

When it goes wrong

SymptomCheckFix
Clicking the message pin opens no text box.Look for a colored wire still attached to the pin.Alt-click that wire or use Break link, then click the unwired pin.
Compile stays grayed out after typing the text.Make sure the text box closed; press Enter if it is still open.Hover Compile; its tooltip says when a pending change needs attention.
The typed message stays marked invalid with Text must be quoted.The message pin takes any value, so text needs quotes to say it is text. A bare 5 or true is a number or a yes-or-no instead.Type it as the hint suggests, in double quotes, such as "A coin is ready", and press Enter.
Full-size image