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

Platformer

Install the Platformer sample package from Package Manager, import its sample, play it, then explore coins, stomps, score, and enemy state through visual scripts drawn from its C# methods.

A coin disappears, the score climbs, the door opens, and a stomp turns a walking enemy into a defeated one. The Platformer sample gives you a complete minute of play, then lets you open each decision as a Round Trip visual script and compare it with the canvas you build yourself.

The Platformer sample is a small 2D game written in ordinary C#, made for learning Round Trip on real classes. It is an optional package of the same Round Trip product, Round Trip Sample - Platformer, so you get it from Package Manager > My Assets rather than as a separate download, and installing it also installs Round Trip itself and the Input System. Importing its sample adds its scene, scripts, input actions and art to your project under one folder. Import it into a practice project, not your real game, because those assets could interfere with your own.

Its classes are the examples used across this site: PlayerController, PlayerMotor, ScoreCounter, EnemyStateMachine, EnemyPatrol, Door and others. When a guide or tutorial names one of them, it is showing the finished sample as a picture to compare against. The guides teach you to build the same shapes on your own classes, once their folder is indexed. The Round Trip package lists a second sample, Graph Viewer Sample; this page uses Platformer.

  • Round Trip is installed in the project (Install).
  • The project uses Unity 6 or Unity 2022.3 and the Universal Render Pipeline (URP). The Universal 2D template has it, so it is the easiest practice project. The sample does not support the Built-in Render Pipeline or the old Input Manager.
  • The Round Trip Sample - Platformer package is installed from My Assets. It installs the Input System with it, and Unity may then ask to enable the Input System’s input backend and restart the editor. Round Trip itself never asks for that; only this optional package does.

Package Manager copies the sample into Assets/Samples/Round Trip Sample - Platformer/<version>/Platformer/, for example Assets/Samples/Round Trip Sample - Platformer/1.0.0/Platformer/. Leave it there: Package Manager tracks what you imported by that path. Every sample path on this site starts at that Platformer folder, so Platformer/Runtime/Player/PlayerController.cs is Assets/Samples/Round Trip Sample - Platformer/<version>/Platformer/Runtime/Player/PlayerController.cs in your project. A few captures on other pages were taken in the project the sample is authored in, where the same folder sits at Assets/Platformer; the contents are the same.

Round Trip finds the classes by itself. When the import finishes it adds the copy’s Runtime folder to the folders it indexes and writes one information line to the Console naming the folder it added; there are no warnings or errors. No dialog opens, and you do not need the Setup wizard or Add folder to Round Trip for this sample.

When you update the Platformer sample package and import the sample again, Package Manager creates a new versioned folder next to the old one. Round Trip adds the new copy’s Runtime folder. Delete the old version’s folder, because two copies of the same assembly cannot compile together.

The Platformer sample in Play Mode: coins, a patrolling enemy, and the goal door at the end of the run.
The Platformer sample in Play Mode: coins, a patrolling enemy, and the goal door at the end of the run.

Play it in one minute

1 minute

Scene
Platformer/Scenes/Platformer.unity
Select
Player in the Hierarchy
Controls
Arrows or A/D move, Space jumps
Goal
Collect coins, stomp enemies, reach the goal
  • Guard clauses: a yellow BRANCH with a magenta EXIT node on one side stops a duplicate collection, a missing component reference, or a repeat stomp before anything changes.
  • Calls: teal call nodes show which other objects the player talks to: the coin, the score counter, the HUD, the motor and the audio service.
  • Loops: a yellow FOR node checks each collision contact to decide whether the player is standing on the ground.
  • Branches: yellow BRANCH nodes choose the score and HUD paths only when their references are present.
  • Switch: one yellow SWITCH node gives each enemy state its own row of nodes that turn patrol and the body collider on or off; the defeated row also applies the defeated look.
  • GET and SET: pills and SET nodes show where tuning values and current state enter each decision.

From the level to the method behind a pickup

Select a screenshot to enlarge it.

The Platformer level with a jumping player, coins, two enemies and the goal door at the right.
Figure 1. Play the level Coins and enemies sit along the route to the door. Use the controls above to try the interactions before opening their methods.
PlayerController has CollectCoin open in Round Trip graphs. The selected method and its GUARDS card are visible. The CollectCoin row in the Methods list is highlighted, with an arrow pointing at it.
Figure 2. Open the pickup method Follow the steps below, then choose PlayerController and CollectCoin. Follow the white route to read the pickup calls; the right rail lists required references.

Import the sample and read its first method

  1. Open Package Manager

    Choose Window > Package Management > Package Manager. In Unity 2022.3 the item is Window > Package Manager.

    Unity's Window menu is open with its Package Management submenu showing. Package Manager, the first item of the submenu, is highlighted with an arrow pointing at it.
  2. Select Round Trip Sample - Platformer

    In My Assets, install Round Trip Sample - Platformer, then select it under Packages - Bit Quirky, LLC.

    Package Manager listing the packages in the project. Under Packages - Bit Quirky, LLC, the Round Trip Sample - Platformer 1.0.0 row, below Bit Quirky Graph and Round Trip, is highlighted with an arrow pointing at it. Its technical name is io.bitquirky.roundtrip.platformer and its tabs, Details through Samples, sit above the details.
  3. Open the Samples tab

    Open the Samples tab of Round Trip Sample - Platformer.

    The Samples tab of Round Trip Sample - Platformer is highlighted with an arrow pointing at it. Under it the tab lists one sample, Platformer, with an Import button. Its description says it needs URP.
  4. Import Platformer

    Press Import next to Platformer and wait for Unity to finish reloading.

    The Samples tab with the Import button beside Platformer highlighted and an arrow pointing at it.
    The Samples tab after the import. The Platformer row is highlighted: it now has a check mark and Reimport and Locate buttons.
    In the Project window, Assets, Samples, Round Trip Sample - Platformer, 1.0.0 and Platformer are expanded and the Platformer folder is highlighted with an arrow pointing at it. It lists Config, Input, Runtime, Scenes, ThirdParty and UI. The path at the bottom reads Assets/Samples/Round Trip Sample - Platformer/1.0.0/Platformer. The Console below the Game view holds one information line about the include path Round Trip added, and no warnings or errors.
  5. Open the scene

    Open Platformer/Scenes/Platformer.unity by double-clicking it in the Project window.

    Platformer/Scenes/Platformer.unity is selected and highlighted in the Project window, with an arrow pointing at it. The Hierarchy lists the loaded scene's objects.
  6. Press Play

    Press Play and move with the arrow keys or A and D; jump with Space.

    The Game view in Play Mode shows the Platformer level with the player, coins, enemies and the HUD. The Play button at the top, now showing as Stop, is highlighted with an arrow pointing at it.
  7. Open Graph view

    Open Tools > Round Trip > Graph view. The Round Trip window opens.

    Clip: Unity's Tools menu opens, then its Round Trip entry, then the Graph view command, and the Round Trip graphs window appears. Each menu item the reader chooses is highlighted with an arrow in turn: Tools, Round Trip, then Graph view.
  8. Pick PlayerController and CollectCoin

    Click the class chip at the left of the top rail, or press Cmd/Ctrl+O. Choose the Runtime scope, pick PlayerController, then click CollectCoin in the Methods list of the left rail.

    Clip: the class picker opens, the Runtime scope is chosen, PlayerController is selected, and CollectCoin is opened from the Methods list so its diagram appears. In turn the class chip, the Runtime row, the PlayerController row and the CollectCoin row are highlighted with arrows.
    The class picker lists the Runtime scope with 19 classes, including AudioCuePlayer, Coin, CoinUnlockRule, CompletionRestartRule, Door and Enemy, each with a path under Assets/Samples/Round Trip Sample - Platformer/1.0.0/Platformer.

The same steps on Unity 2022.3

Select a screenshot to enlarge it.

Unity 2022.3 with its Window menu open. The Package Manager item is highlighted with an arrow pointing at it. The item sits directly under Window, with no Package Management submenu.
Figure 3. Open Package Manager In Unity 2022.3 the item is Window > Package Manager.
Unity 2022.3 Package Manager showing Packages: In Project, with Round Trip Sample - Platformer 1.0.0 selected under Packages - Bit Quirky, LLC. Its row is highlighted. Its tabs sit above the description.
Figure 4. Select Round Trip Sample - Platformer The list is headed Packages: In Project. Round Trip Sample - Platformer sits under Packages - Bit Quirky, LLC, beside Round Trip and Bit Quirky Graph.
The Samples tab of Round Trip Sample - Platformer in Unity 2022.3 lists Platformer with an Import button. The Samples tab is highlighted, with an arrow pointing at it.
Figure 5. Open the Samples tab The Samples tab is the last tab.
The Samples tab in Unity 2022.3 after the import: the Platformer row is highlighted. It shows a check mark and a Reimport button.
Figure 6. Import Platformer The row ends in a check mark and Reimport, as in Unity 6.
Unity 2022.3 Project window with Assets, Samples, Round Trip Sample - Platformer, 1.0.0 and Platformer expanded. The selected Platformer folder is highlighted with an arrow pointing at it. The Console holds one information line about the include path Round Trip added.
Figure 7. Find the imported folder The same folder, and the same single information line in the Console. Opening the scene and pressing Play work as on Unity 6.
The Game view of Unity 2022.3 in Play Mode shows the Platformer level with the player after moving right. The Play button in the toolbar is highlighted with an arrow pointing at it.
Figure 8. Press Play Play on Unity 2022.3 with the Input System 1.14.2 package.
Method to open What the canvas shows What to notice when you play
CollectCoin on PlayerController An early stop, then four call nodes in a row. The coin arrives from the trigger you touch. Score and HUD are set up in the scene; audio is optional.
StompEnemy on PlayerController A guarded state change and a bounce, then score and HUD branches inside one another. The score you gain comes from stompScoreValue on the LevelRules asset.
UpdateGrounded on PlayerMotor A FOR node checks each contact and reaches EXIT at the first one facing up. Walls do not count as ground; only contacts facing up past the grounding threshold do.
OnCoinCountChanged on ScoreCounter A missing-reference stop, a threshold check, and a call node on the door. The door opens when the coin count reaches the threshold from LevelRules.
ApplyState on EnemyStateMachine One SWITCH node with one output per enemy state. Each state turns patrol and collision on or off; the defeated state also changes the look.

CollectCoin starts at its magenta entry node, whose purple coin pin carries the coin you touched. The yellow BRANCH sends a coin that is missing or already collected to an EXIT node, and the method also stops when the scene’s score counter or HUD is missing. Only then does the white wire reach the teal Collect call on the coin, the AddCoins call on the score counter, the RefreshCoins call on the HUD, and the PlayCoin call on the optional audio service.

That order is the lesson. Each teal node names one neighbor, and the colored wires show which values cross from one object to the next. The canvas is the method itself, so what you see is what runs.

The same game, rebuilt without writing code

Section titled “The same game, rebuilt without writing code”

The same platformer is also being rebuilt on camera, one episode at a time, with every method built on the Round Trip canvas and none of it typed. That tutorial build contains only what the published episodes have built so far, starting with LevelRules, PlayerMotor and the scene setup code that connects the components, plus script-free prefabs for the tiles, player, coin, enemy and goal door to build from. Open the finished Platformer sample when you want a complete picture to compare against; follow the episodes when you want to watch the build.

Full-size image