Daniel Falci
Sign in Buy the course

Get and Set in Blueprints: reading and writing a variable

A Get node reads the current value of a variable, and a Set node writes a new one. Ctrl-drag a variable into the graph for a Get and Alt-drag for a Set. Set has execution pins, so it joins the flow, and the order matters: a Print String before the Set shows the old value, after it shows the new one.

See the course Watch a free lesson

From the course

Taken from the hands-on project of the course; the lessons show every step on video.

What are Get and Set?

When you drag a variable such as a StringVar into the Event Graph you choose Get or Set. Ctrl and Alt make it faster: Ctrl for Get, Alt for Set. A Get reads the current value, which you can connect to a Print String to display it.

How is Set different from Get?

A Set records a new value during gameplay. Unlike the Get node, it has two data output pins and two execution pins, so it connects to your execution flow, for example after Event Begin Play.

Example from the lesson

Why does the order matter?

The Print String shows NEW TEXT because the value was changed before printing. If the Print String came before the Set, the printed value would be the default value of the variable.

Free PDFs that go with this page

One-page guides made from the lessons, sent by e-mail.

Frequently asked questions

How do I create a Get or Set quickly?

Hold Ctrl while dragging the variable for a Get, or Alt for a Set.

Does a Set node have execution pins?

Yes. It connects to the execution flow, unlike a Get.

What does Set do to the default value?

It changes the value during gameplay. The default value in the Details panel stays as it was defined.

Related guides

See the course