Learn

Chapter 01 Blueprint Fundamentals

#005 Variables

Health, ammo, score: where does your Blueprint keep them?

  • 0:43 video
  • Written lesson
  • Beginner
Video lesson: Variables, 0:43

What a variable is

A Variable is a named value that belongs to your Blueprint: health, ammo, score. Create one in the My Blueprint panel, then choose its type, like Float for Health. Compile, and set its Default Value in the Details panel.

Every placed enemy keeps its own copy of Health.

Reading and writing

  • A Get node reads the value. It has no execution pins.
  • A Set node writes a new value, so it needs an execution wire to run.

When the enemy takes damage, Set Health to Health minus Damage. The next time you read Health, you get the new value.

Different values per instance

Click the eye icon next to the variable to make Health Instance Editable. Now each enemy you place in the level can start with a different Health, set in its Details panel.

In short

Get reads the value. Set changes the value.

Covered in this lesson

  • Variable
  • Default Value
  • Get
  • Set
  • Instance Editable
  • My Blueprint panel

Newsletter

Development updates are coming to your inbox.

The newsletter opens soon. Until then, new lessons, tools and Beach Hunters progress appear first on our channels, linked below.