Variables are containers. Each variable has a name, a type, and a value

The value inside a variable can change during runtime, which is why they're called vary-ables.

In Bolt, there are 6 kinds of variables:

Icon Kind Description
Flow Variables Flow variables which are the equivalent to local variables.
Graph Variables Graph variables are local to an instance of a flow graph. They have the smallest scope and cannot be accessed or modified outside their graph.
Object Variables Object variables belong to a game object. They are shared across all graphs on that game object.
Scene Variables Scene variables are shared across the current scene. 
Application Variables Application variables persist even when the scene changes. They will be reset once the application quits.
Saved Variables Saved variables will persist even after the application quits. They can be used as a simple but powerful save system. They are saved in Unity's player prefs, which means they unfortunately can't refer to Unity objects like game objects and components. 

The variables window

The variables window can be opened via Windows > Variables. It contains one tab per kind of variable. The graph tab is only enabled if a flow graph is selected, and the object tab is only enabled if a game object is selected.

Adding a variable

  1. Choose the tab corresponding to the kind of variable you want to add
  2. Type the name of the new variable in the  field
  3. Click the  button
  4. Choose its 
  5. (Optional) Change its default value

Saved & Initial Variables

You may notice that under the Saved tab, there are two sub-tabs: Initial and Saved.

In the initial tab, you define values that will automatically created for new games.

In the saved tab, you can see the state of saved variables for your current computer. You can edit these manually or delete them all if you want to start anew.


Removing Headers

Once you get a good grip of how each kind of variable works, you can remove the headers in the variables window to save some screen real-estate. Simply uncheck Show Variables Help in Tools > Bolt > Editor Preferences....

Dynamic Variables

Variables don't need to be declared during edit mode! They can also be created during play mode.

Setting the value of a variable that doesn't exist automatically creates it. For example, this graph would create a new saved integer variable named gold with a value of 250, even if we hadn't defined it before:


For more information about variable units, have a look at the Unit Reference.


Note that all object variables in Bolt are public and can be accessed by other objects.

This article was helpful for 53 people. Is this article helpful for you?

Just want to let you know this line of text needs to be corrected, thanks:

'In the initial tab, you define values are will automatically created for new games.'


I realised I tend to not use graph variables as if I later want to convert some bits to a Superunit, then I will need to recreate the same variables inside the superunit. Am I missing something or there's a way (apart from inputs) to share variables between graphs and superunits?


Interesting problem; there is no way to share those variables by design. I will think about improving the workflow for this when converting the selection to a super unit.


I currently see variables on the object (directly where the graph a variables component is attached), the scenes ones (a game object Scene Variables is added to the scene), but the application ones and the saved ones don't know where they are (there is a DontDestroyOnLoad variables and an events object) but still not clear. The only place visible is inside the graphs themselves, is there a way to have visibility outside?

Or maybe I should just add a helper script to the scene that uses the Variables API?