Variables
Make GET pills and SET nodes by dragging variables, properties, and locals from the Variables rail onto the canvas.
On this page
A row in the Variables rail is both a list entry and a handle. Drag it onto the canvas to read the value with a GET pill or change it with a SET node.
What it does
Section titled “What it does”The lower half of the left rail lists stored values. Variables holds the class’s variables and storage-like properties, and Local variables holds the open method’s own values. Dragging a row onto the canvas makes a GET pill or a SET node tied to that exact variable, so you never type a name into a search box and pick a lookalike from another class.
Looking for a property that is under Methods instead? Properties normally appear here, but a getter that calculates a result or a setter that runs behavior belongs under Methods. This exposes the code that runs when the property is used; it does not turn the property into a C# method. Properties: Variables or Methods? explains the rule with screenshots and code from God Complex.
When to use it
Section titled “When to use it”Reach for the rail whenever a node needs a value the component keeps, or should change one: the player’s health after a hit, the coin count after a pickup, the direction a patrolling enemy faces after it reaches a wall, a cooldown timer that counts down each frame. Use GET to read the value and SET to change it.
A property row offers only what it has: a read, a write, or both. In a method marked Static, the class’s ordinary variables are unavailable, because there is no particular object to read them from.
What it looks like
Section titled “What it looks like”How to use it
Section titled “How to use it”The captures use the Platformer scene and PlayerController. The SET node is repositioned and the canvas framed for readability; the pointer and click markers in the clips are site overlays.
Read and update a variable
Add a method
In the left rail, click + on the Methods header and press Enter. A magenta entry node appears on the canvas.
Add a variable and a local variable
Click + on the Variables header. A new row opens with a name box. Type
coinsand press Enter. The row shows its type,int, with a green dot. Click + on the Local variables header the same way: a row namednewVaropens for renaming.
5 stepsFull size ↗Place a SET node
Press on the
coinsrow and drag it onto empty canvas. When you let go, a small menu offers get coins and set coins. Click set coins. A dark blue node appears with coins on the left of its header and SET on the right, white Exec pins, a green Value input, and a Value output.
2 stepsFull size ↗Connect execution
Drag a white wire from the entry node’s Exec pin to the SET node’s Exec pin. The node is now on the white path.
2 stepsFull size ↗Read and add one
Drag the
coinsrow onto the canvas again and choose get coins. A green pill labeled coins appears. Right-click empty canvas and, under OPERATORS, click Add. Wire the pill’s dot into the Add node’s first input, type1in the box beside its second input, and wire the Add node’s output into the SET node’s green Value pin.
10 stepsFull size ↗Use the row menu
Right-click a row instead of dragging it. Create get node and Create set node place the same pill or node on the canvas.
Compile the change
Press Compile in the toolbar at the top of the Graph view. Round Trip writes the change, the canvas reloads, and the SET node stays on the white path with the pill feeding it.
What it writes
Section titled “What it writes”If you also work in C#, a GET and a SET on a variable named _direction appear in the script like this:
A GET supplies its value inside the node it feeds. A SET writes a line of its own on the white path. A SET on a property uses the property’s setter, so it exists only when the property has one.
When it goes wrong
Section titled “When it goes wrong”When it goes wrong
| Symptom | Check | Fix |
|---|---|---|
| Create Set Node is dimmed and reads read only. | Read the row: a read-only property or a constant cannot be changed. | Use Create Get Node to read it, or pick a variable that can be changed. |
| Dragging a variable onto the canvas does nothing. | Look at the method in the inspector: Static is ticked, and the variable belongs to each object. | Use a static variable, or work in a method without Static ticked. |
| The drag menu offers the wrong variables. | Read the Local variables header: it names the method the rail is showing. | Click the method you mean in the Methods list first, then drag from the refreshed rail. |
| A new variable cannot be dragged. | Look for an empty name box on the row. | Type a name and press Enter. A variable with no name has nothing to read or write. |
- Pills and literals: feed pins from pills and typed values.
- Fields and defaults: set a new variable’s type and starting value.
- Get and set: read a value and change it on the white path.
- Preview and Compile: save the new SET node into the script.




