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

Call a neighbor

Build a coin pickup on the canvas as a guard followed by a row of calls into the coin, score, HUD, and audio components.

Many interactions are a handoff. One method checks that the moment is valid, then asks each component that owns a piece of the work to do it, in the order the white wire shows. On the canvas that is a guard at the left and a row of call nodes along one white wire, each node’s Target pin wired from the component it talks to. In the Platformer sample, the player checks the coin, then calls the coin and score counter. The HUD and audio player follow in turn.

This page builds that shape from an empty canvas. It uses the sample’s PlayerController class so every name on the nodes is real. In your own project, build the same shape in any class that calls into other components, once its folder is indexed.

The player notices the coin’s trigger, but the coin owns whether it has been collected, the score counter owns the totals, the HUD owns what is on screen, and the audio player owns the sound. The player’s job is to ask each of them, in the right order.

  • Picking something up, opening a chest, or taking damage has to update several parts of the scene at once.
  • Each part already has its own component with a method that names its job.
  • The order matters: the HUD should show the new score, so the score must change first.

Build PickUpCoin from an empty canvas

  1. Add a method

    Open Tools > Round Trip > Graph view, press Cmd/Ctrl+O and choose PlayerController. Press the + on the Methods section of the left rail, type PickUpCoin in the name box and press Enter. In the right rail’s Inputs card, press +, choose Coin as the type and type coin as the name. The magenta entry node titled PickUpCoin now has an Exec pin and a purple coin pin.

    Clip: the pointer presses Ctrl+O, the class picker opens and PlayerController is chosen, then + on Methods names a PickUpCoin entry node, and + on Inputs adds a Coin input named coin. While the pointer presses the plus on Methods and the plus on the right rail's Inputs card, each is highlighted with an arrow pointing at it.
    The whole Graph view with PlayerController open. The plus beside Methods on the left rail is highlighted, with an arrow pointing at it.
    The whole Graph view with the new PickUpCoin entry node on the canvas. The plus on the right rail's Inputs card is highlighted, with an arrow pointing at it.
  2. Place the guard

    Guard the coin. Right-click blank canvas and pick branch under flow control; wire the entry node’s Exec into it. Place an Equals node from operators, wire the coin pin into Left and type null into Right.

    Clip: branch is placed and wired from the entry node, then Equals is fed by the coin pin and null. While the pointer rests on a pin to drag from, it is highlighted with an arrow pointing at it. Each menu choice is highlighted with an arrow pointing at it while the pointer rests on it: the branch row, then the Equals row.
  3. Stop on a missing or spent coin

    Drag from the coin pin onto empty canvas and press get on IsCollected. Place an Or node, wire the Equals node’s Result and the IsCollected pill into it, and wire its Result into the branch’s Condition. Place a return from flow control and wire the branch’s true output into the magenta EXIT node. A missing or spent coin stops here.

    Clip: IsCollected is gotten from the coin pin, Or combines it with the Equals result into the branch's condition, and return is wired from the branch's true output. While the pointer rests on a pill or pin to drag from, it is highlighted with an arrow pointing at it. Each menu choice is highlighted with an arrow pointing at it while the pointer rests on it: the get button on the IsCollected row, then the Or row, then the return row.
  4. Require the score counter and the HUD

    Require the score counter and the HUD. In the right rail’s Guards card, press Add a check. The Require a value list opens; pick _scoreCounter. Choose Warn and skip the rest of this method as what happens when one is missing. On the new check, press Add another value to this check and pick _hud.

    The right rail's Guards card, highlighted, reads All of these must be set and checked together. It lists _scoreCounter and _hud, each with a Split out button. Warn and skip the rest of this method is chosen.
  5. Call the coin

    Call the coin. Drag from the entry node’s coin pin onto empty canvas. A menu headed by the coin lists its variables and methods; click Collect. A teal node titled Collect appears with Coin above its title and its Target already wired from the coin pin. Wire the branch’s false output into its Exec.

    Clip: the pointer drags from the entry node's coin pin onto empty canvas, a menu lists the coin's members, and clicking Collect places a teal Collect node wired from the coin pin, then the branch's false output is wired into Collect's exec. While the pointer rests on the coin pin and on the branch's false output to drag from, each is highlighted with an arrow pointing at it. The menu choice is highlighted with an arrow pointing at it while the pointer rests on it: the Collect row.
  6. Call the score counter

    Call the score counter. Right-click, type _scoreCounter, press get, then drag from the purple pill and click AddCoins. Wire the Collect node’s Exec output into it. Get a CoinsPerPickup pill and drag it onto the green count pin.

    Clip: right-click and type _scoreCounter, then press get to place a purple pill. Dragging from the pill and clicking AddCoins places a teal AddCoins node, wired from Collect's exec and fed by a CoinsPerPickup pill on count. While the pointer rests on a pill or pin to drag from, it is highlighted with an arrow pointing at it. Each menu choice is highlighted with an arrow pointing at it while the pointer rests on it: the get button on the _scoreCounter row, then the AddCoins row, then the get button on the CoinsPerPickup row.
  7. Call the HUD with the new totals

    Call the HUD with the new totals. Get a _hud pill, drag from it and click RefreshCoins. Wire AddCoins’ Exec output into it. Get a second _scoreCounter pill, drag from it twice, pressing get on Coins and then on Score, and wire the two green pills into coins and score.

    Clip: a _hud pill is gotten by right-click, dragging from it and clicking RefreshCoins places a teal RefreshCoins node wired from AddCoins' exec, then a second _scoreCounter pill is gotten and dragged from twice for Coins and Score, each wired into RefreshCoins. While the pointer rests on a pill to drag from, it is highlighted with an arrow pointing at it. Each menu choice is highlighted with an arrow pointing at it while the pointer rests on it: the get button on the _hud row, then the RefreshCoins row, then the get button on the _scoreCounter row, then the get button on the Coins row, then the get button on the Score row.
  8. Call the audio player

    Call the audio player. Get an _audio pill, drag from it and click PlayCoin. Wire RefreshCoins’ Exec output into it.

    Clip: an _audio pill is gotten by right-click, dragging from it and clicking PlayCoin places a teal PlayCoin node, wired from the pill and from RefreshCoins' exec output. While the pointer rests on a pill or pin to drag from, it is highlighted with an arrow pointing at it. Each menu choice is highlighted with an arrow pointing at it while the pointer rests on it: the get button on the _audio row, then the PlayCoin row.
  9. Compile

    Press Compile in the toolbar.

    The whole Graph view with the finished PickUpCoin graph. The toolbar Compile button is amber and highlighted with an arrow pointing at it, because the canvas holds changes that are not in the C# file yet.
    After Compile the canvas reloads from the script: the guard branch into EXIT on true, and Collect, AddCoins, RefreshCoins, PlayCoin in order on false, each target pin showing a dashed shield ring.

If you also work in C#, this is the sample’s CollectCoin, the finished shape the steps build toward: a guard branch, then Collect (target from the coin pin), AddCoins (target from the _scoreCounter pill, count from CoinsPerPickup), RefreshCoins (fed by the Coins and Score pills) and PlayCoin (target from _audio). Your PickUpCoin writes the same guard and the same four calls in order; the check from the Guards card is written as its own early exit with a warning.

In the sample, the audio call runs only when an audio player is present, so a scene without one still collects coins.

When it goes wrong

SymptomCheckFix
The HUD shows the previous coin total.Follow the white wire: does RefreshCoins come before AddCoins?Rewire so AddCoins runs first and RefreshCoins follows it.
A scene without an audio player stops collecting coins.Open the Guards card and read which values the check requires.Keep _audio out of the check; require only _scoreCounter and _hud.
The same coin scores twice.Follow the guard branch: does an IsCollected pill feed its condition, and does Collect run first on false?Feed IsCollected into the Or node, and keep Collect as the first node after the guard.
  • Method calls: choose the object to call and fill its argument pins.
  • Get and set: read updated properties for the next call.
  • Branch: protect required component references with early exits.
Full-size image