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 enter a complete API identifier.

Browse the reference instead

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

v0.89.0
Menu

Fields and defaults

Add fields, understand property storage, and author declaration defaults from the rail.

A jump force belongs with the level rules, not hidden inside a movement method. A named field gives the value one home and one default.

LevelRules groups progression and player tuning fields. Each declaration has a type, a source order, optional attributes, and an initializer that Unity can expose or other code can read.

Use a field for state the class owns. Use a declaration initializer when a value type or reference should start with a known value. Use a property when callers need a controlled read or write surface.

The Default card distinguishes three useful origins. From your code means Round Trip recognized an existing source default. Edited · draft means the rail holds a pending change. CUSTOMIZED appears while an amend flow differs from the recognized source shape.

The Variables rail for PlayerController
Figure 1. The Variables section and its source-backed members.

The left rail shows fields and folded properties under Variables. A DEFAULT child opens an initializer in the scoped Default value graph.

  1. Select the class and open Variables in the left rail.
  2. Press + on the Variables header (Add a field to this class) and type the new field’s name on its row. Then choose access, constant state, attributes, and Inspector options in the right rail.
  3. Click the row’s type to open the type chooser. most used comes first: the C# built-ins, List<T>, Dictionary<TKey, TValue>, and the Unity types scripts reach for most. Then come your project, unity, .net, and other. Each type is spelled the way the class’s file can read it. Type to search: the list updates once you pause and shows up to 50 matches per section. Right after a graph opens, while the type index is still building, the most used types are listed at once.
  4. Choose array to be asked what the array holds. Choose a generic type such as List<T> and the chooser asks for each type argument in turn, its heading showing what is still open: Dictionary<TKey, TValue> becomes Dictionary<string, TValue> after the first choice and is written as Dictionary<string, int> after the second. A method’s inputs and outputs in the right rail use the same chooser.
  5. For a value type with no initializer, open the Default card and choose a literal or computed expression. The literal is written as a declaration initializer.
  6. For a recognized default, choose Edit default. The state changes from From your code to Edited · draft as soon as the draft differs.
  7. For a storage-backed property, inspect the Storage card. A getter-only fold is read-only; a writable fold routes reads and writes through the property name.
  8. Open the DEFAULT child in the left rail for a graphable initializer. The scoped view reads Default value graph, Rail, READ-ONLY · V1, and View source when a source span exists. Its lock explains Read-only · v1: edit defaults in the right rail.
  9. Inspect the initializer graph. This canvas is for reading only. Return to the rail to edit or remove the whole default.
  10. Press Compile. Round Trip writes the declaration change, imports the file, and rebuilds the field and property views from source.

When it goes wrong

SymptomCheckFix
Compile is disabledLook for an invalid literal, missing field name, or missing type.Repair the field-local callout before compiling.
Create Set Node is unavailable for a propertyRead the Storage card access state.Use the backing field where appropriate or add a setter as a separate draft.
The initializer graph is read-onlyLook for READ-ONLY · V1 in the identity strip.Use Rail to return and edit the default in the right rail.
Full-size image