Blueprint Basics · Beginner · 13 min
Blueprint Variables: Store and Change Values to Drive Behaviour
Create your first Blueprint variable, pick the right type, set a default, expose it with the eye icon, and use Get and Set nodes to make your variable actually change what your Actor does.
Before this: What Is a Blueprint? Create Your First One (No Code Required), Event Graph Basics: BeginPlay, Nodes, and Wires Explained
- Create a Blueprint variable and choose the right type for the job
- Set a default value and understand the difference between Get and Set nodes
- Make a variable editable per-placed-Actor with Instance Editable (the eye)
- Use a variable to drive a real behaviour in your Blueprint
What a variable actually is
A variable is just a labelled box that remembers a value for you. You give the box a name, decide what kind of thing it holds, and from then on your Blueprint can read what's inside or drop a new value in. That's the whole idea — a memory slot with a name.
Why bother? Because without variables, every number in your Blueprint is hard-coded and frozen. With a variable like 'Speed' or 'Health' or 'IsDoorOpen', you can read it in fifty places, change it in one, and tweak it per object without ever reopening the graph. Variables are how a Blueprint stops being a fixed script and starts being something you can configure. In this lesson you'll make one, choose its type, give it a starting value, expose it so you can edit it on each placed copy, and then use it to actually change what your Actor does.
Five words to lock in first
Tap a card to flip it
The five types you'll use 90% of the time
When you create a variable, Unreal asks for its type. There are dozens, but as a beginner you'll lean on just a handful. Knowing which to reach for saves a lot of fumbling.
Boolean (often shown as 'Bool') holds true or false — perfect for yes/no questions like IsDoorOpen or HasKey. Integer holds whole numbers like 0, 5 or -3 — good for counts such as lives or coins. Float holds decimal numbers like 1.5 or 0.25 — use it for anything smooth like speed, health or a timer. String holds text like "Game Over" or a player's name. Vector holds three floats together (X, Y, Z) and is how Unreal represents a position, a direction or an amount of movement in 3D space.
Each type is colour-coded in the graph: Boolean is red, Integer is teal/green, Float is light green, String is magenta/pink, and Vector is gold/yellow. You don't need to memorise the colours — they're just a visual hint that two pins are compatible.
Create a variable and use it
Open any Blueprint you've made (the Actor Blueprint from the earlier lessons is perfect). Work top to bottom — each step stays ticked if you step away and come back.
- 1Find the My Blueprint panel
Inside the Blueprint editor, look at the left-hand 'My Blueprint' panel. It lists your Graphs, Functions and — the bit we want — Variables.
Hover the 'Variables' category and click the small '+' that appears (or right-click in an empty part of the graph and choose 'Add Variable').
TipIf you can't see the My Blueprint panel, open it from Window → My Blueprint. It's the home for everything your Blueprint owns.
- 2Name it clearly
A new variable appears ready for you to type a name. Call it something that reads like English — 'Speed', 'IsOn', 'CoinCount'. Avoid spaces; Unreal uses CamelCase by convention.
Good names are half the battle. 'Speed' tells you what it is at a glance; 'var2' tells you nothing in a week's time.
TipBoolean variables read best as a yes/no question: 'IsOpen', 'HasKey', 'CanJump'. Then your logic literally reads 'if IsOpen…'.
- 3Pick its type
With the variable selected, look at the Details panel on the right. The first row is 'Variable Type' — a coloured dropdown. Click it and choose your type. For a smooth value like speed, pick 'Float'. For a yes/no, pick 'Boolean'.
The dropdown also has a search box, and a small grid icon to the right of each type that opens 'array/set/map' container options — ignore those for now; you want the plain single value.
TipPicked the wrong type? Just change the dropdown again. Unreal will warn you if existing nodes no longer fit, so change the type before you wire it up everywhere.
- 4Compile, then set a default value
Click 'Compile' in the top-left toolbar (the little processor icon). A variable has no default value until the Blueprint compiles at least once — this catches everyone.
Now look back at the Details panel. A 'Default Value' section appears at the bottom. Type your starting value there — for a Float Speed you might enter 200.0.
TipIf the Default Value box is greyed out or missing, you haven't compiled yet. Hit Compile and it appears.
- 5Drag it into the graph: Get or Set
Drag the variable from the My Blueprint panel into the graph. Unreal asks 'Get' or 'Set'. 'Get' drops a node that reads the value (one output pin, no execution wire). 'Set' drops a node that writes a new value (it has the white execution pins, so it sits in your flow).
Quick shortcuts: hold Ctrl while dragging to drop a Get directly, or hold Alt while dragging to drop a Set directly.
TipRule of thumb — if you only want to USE the value, you need Get. If you want to CHANGE it, you need Set.
- 6Wire it into something that runs
Use your variable for real. For example, from a 'Set' node connected after Event BeginPlay, set Speed to a new value when the game starts. Or feed a 'Get Speed' into a Print String so you can see it.
Compile and Save. You've now created a value, given it a default, and both read and written it from your graph.
TipReusing the events lesson: drag off Event BeginPlay's execution pin, add a Set node for your variable, then continue the white wire to a Print String to confirm it changed.
Get vs Set — the one distinction that trips everyone up
A Get node simply hands you the current value. It has a single coloured output pin and NO white execution pins — because reading doesn't 'happen' in time, it's just available whenever a node asks for it.
Use Get wherever a node needs the value as an input: plug 'Get Speed' into a movement node, or 'Get IsOpen' into a Branch's condition.
A Set node changes the stored value to whatever you plug into it. It DOES have the white execution pins (an in and an out), because writing is an action that happens at a moment in time — it has to sit on the execution flow.
Use Set when something should change: 'Set IsOpen = true' when the player opens a door, or 'Set CoinCount = CoinCount + 1' when they grab a coin (drag off Get, add to it, feed the result into Set).
You opened the eye (Instance Editable) and set a placed Actor's Speed to 500 in the level. But the variable's Default Value in the Blueprint still says 200. Which value wins for that placed Actor — and why?
The placed Actor uses 500. The Blueprint's Default Value (200) is the starting value for any NEW copy you place, but once you override it on a specific instance in the level, that per-instance value takes priority for that one Actor.
Think of it as two layers: the Blueprint default is the factory setting; the instance value is a sticker you put on one particular copy. The sticker wins for that copy. Place a fresh, untouched copy and it'll be 200 again, because nobody put a sticker on it yet.
QuizCheck yourself
1You want a variable that stores whether a door is open or closed. Which type fits best?
A door is either open or closed — a yes/no value — which is exactly what a Boolean (true/false) is for.
2What's the key difference between a Get node and a Set node?
Get reads (no white exec pins, available any time). Set writes (it has exec pins because changing a value is an action that happens at a moment in time).
3Your new variable's Default Value box is greyed out. What did you most likely forget?
A variable has no default until the Blueprint compiles at least once. Click Compile and the Default Value field appears in the Details panel.
Variable shortcuts worth knowing
- Ctrl drag variable Drop a Get node straight into the graph (skips the Get/Set menu)
- Alt drag variable Drop a Set node straight into the graph
- F2 Rename the selected variable in the My Blueprint panel
- Ctrl S Save the Blueprint asset once it compiles cleanly
In an Actor Blueprint, create a Float variable called 'StartScore' with a default of 0. Make it Instance Editable (open the eye). On Event BeginPlay, Set StartScore to 100, then Print String the current value so you can read it when you press Play. Finally, place two copies of the Actor in the level and give each a different StartScore from the level Details panel — then explain to yourself which value each prints and why.
Hint 1
Create the variable, set its type to Float in the Details panel, then Compile so the Default Value field appears and set it to 0.
Hint 2
Open the eye icon next to the variable name (or tick 'Instance Editable') so you can edit it per placed copy.
Hint 3
From Event BeginPlay's white pin, add a Set StartScore node, type 100 into its value pin, then drag onward to a Print String fed by a Get StartScore.
Hint 4
Place two copies in the level; with each selected, find StartScore in the Details panel and type a different number.
Add Variable → name 'StartScore' → Details: Variable Type = Float → Compile → Default Value = 0. Click the eye open to make it Instance Editable.
In the Event Graph, drag off Event BeginPlay, add 'Set StartScore' and enter 100. From its execution out, add a Print String; drag a 'Get StartScore' into the Print String's In String pin (Unreal auto-adds a Float-to-String conversion). Compile and Save.
Because BeginPlay runs Set StartScore = 100 on EVERY copy at play start, both placed Actors will print 100 — the BeginPlay Set overwrites whatever per-instance value you typed. That's the lesson: an instance value sets the STARTING value, but a Set node at runtime overrides it. Remove the Set (or only Set when StartScore is still 0) and each copy would instead print the per-instance number you entered in the level.
You can now…
Tick these off — if any feel shaky, re-do the matching step above.
- Create a variable from the My Blueprint panel and name it clearly
- Choose the right type for the value (Boolean, Integer, Float, String or Vector)
- Compile, then set a sensible Default Value in the Details panel
- Tell a Get node from a Set node and use each correctly
- Open the eye (Instance Editable) to tune a variable on each placed Actor
- Use a variable to actually change what your Blueprint does at runtime
Mark this lesson complete
We'll remember it on your Academy page and unlock the next lesson below.
Questions beginners ask
What's the difference between a variable's Default Value and Instance Editable?
The Default Value (set in the Details panel after compiling) is the starting value baked into the Blueprint — every new copy begins with it. Instance Editable (the eye icon) lets you override that value on each placed copy from the level's Details panel, without opening the Blueprint. Default = the factory setting; instance value = a per-copy override.
Why does my Set node have white execution pins but my Get node doesn't?
Reading a value (Get) doesn't 'happen' at a moment in time — the value is just available whenever a node asks for it, so Get needs no execution wire. Changing a value (Set) is an action that occurs at a specific point in your logic, so it sits on the white execution flow with an in and an out pin.
I can't set a Default Value — the box is greyed out. What's wrong?
You haven't compiled yet. A brand-new variable has no default until the Blueprint compiles at least once. Click the Compile button in the top-left toolbar and the Default Value field appears in the Details panel.
How do I know which variable type to choose?
Match the type to the value: true/false → Boolean; whole-number counts → Integer; smooth decimals like speed or health → Float; text → String; a 3D position, direction or movement amount → Vector. When in doubt for a measured quantity, Float is the safe, flexible choice.