To create the functionality for gameplay objects in your level, you’ll use Blueprint Visual Scripting. Blueprints in Unreal Engine are assets with a physical representation and special functionality, like the player being able to pick them up.
The Blueprint Visual Scripting system can be used to create functionality without writing code, as you are using a node-based interface to create a gameplay object’s behavior.
There are different types of Blueprint assets (including data-only Blueprints), but the most common type you’ll be working with is a Blueprint Class, often shortened as Blueprint.
A Blueprint Class is like a recipe that uses components, variables, and Blueprint Visual Scripting to describe the properties and behaviors of objects in your game. You add instances of Blueprint classes to your level.
Before You Begin
You’ll need a Unreal Editor project based on the First Person or Third Person template (any variant).
Open an Existing Blueprint
You created your project from a template, so there are several Blueprints that are already included in your project that you can explore and use.
One example of a Blueprint Class is the jump pad Blueprint, which has functionality that boosts the player upwards. You can add instances of this Blueprint anywhere in your level.
To open the jump pad Blueprint, follow these steps:
In Unreal Engine, click the Content Drawer button at the bottom-left corner of the screen. Alternatively, you can hold down CTRL and press Space.
Navigate to the LevelPrototyping > Interactable > JumpPad folder.
You will see a
BP_JumpPadasset, which is a Blueprint Class. Double-click the asset to open it in the Blueprint Editor.By default, the Blueprint opens in a new window. You can dock a window by clicking the tab with the asset’s name near the top-left corner of the window and dragging it next to the level’s tab in the main editor.
Building a Level Object With Components
Let’s take a look at BP_JumpPad. At the top portion of the window, you can see three tabs: Viewport, EventGraph, and Construction Script.
Click the Viewport tab. You will see the jump pad’s visual representation, with a particle effect playing on a loop. Similar to using the viewport in the main level editor, you use a Blueprint’s Viewport to see and edit a Blueprint.
In this tab, you’ll see the Blueprint’s Components, or the pieces that define what the Blueprint is and what is added to your level.
Use the Components tab to add, remove, and reorganize the Blueprint’s components. Let’s take a closer look at the components that are attached to the jump pad:
BP_JumpPad has a Point Light component. Click the Point Light object in the components list or Viewport. You can use the Transform tools to move and rotate this light source.
On the right-hand side of the Blueprint Editor, you will see the Details panel, which lists the properties related to this light component. You can edit the Intensity of this light source, the Light Color, and more.
Creating Blueprint Functionality
Next to the Viewport tab, you can see the EventGraph and Construction Script tabs. These two tabs are used to add functionality to your Blueprint based on when they run. Here, you’ll create the logic that tells the Blueprint’s components how to behave.
The Construction Script runs when the level object spawns, either during gameplay or when you add it to your level in Unreal Editor. It also executes in the editor when you transform or change a property of an actor, so you see the result immediately in the viewport.
If you click on the Construction Script tab, you will see a Construction Script node that executes a chain of actions that set up the jump pad’s color and other properties when it first appears in the level (or is spawned).
Navigating the Blueprint Graph:
Pan: Right-click and drag.
Zoom: Use the mouse wheel.
Frame selection: Press F to center on selected nodes.
Fit all: Press A to view the entire graph.
Jump to: Double-click a function or event node to find it in a graph or its graph tab.
Click the Event Graph tab. The Event Graph contains logic that runs in response to events that happen during gameplay, such as responding to player input, triggering animations, or playing sounds. Any time you think, “when this happens, I want to do that,” you need to start with an event.
In the jump pad’s event graph, you will see a list of nodes that get executed when an actor overlaps with this Blueprint — meaning when the player walks over this Blueprint in-game. Then, it makes the character perform a jump move, but with a higher velocity than normal.
To find a specific node in a graph, use the CTRL + F shortcut in the graph views to search for a node. For example, to take a look at the Event ActorBeginOverlap node, use the CTRL + F shortcut and type Event ActorBeginOverlap in the search field. Select the result to pan the view to that node.
A node that can execute actions has an Execution pin, also known as an exec pin, marked by the white triangle on this node. If a node’s exec pin is not connected to another node, the triangle will have a white outline but no color.
In addition to the exec pin, a node can also have other pins. For example, the Event ActorBeginOverlap has a pin for Other Actor, which is a reference to the level object (actor) that overlaps with the BP_JumpPad level object.
You’ll notice that the Event node does not have any input exec pin. This is because an Event node runs as soon as the defined event has been triggered. In this example, when an actor overlaps with BP_JumpPad’s actor in-game, this event will trigger.
The Event ActorBeginOverlap node’s exec pin is connected to the Cast To Character node. This means that when an actor in the world, like the Player, overlaps with the jump pad actor, this Blueprint will execute the Cast To Character node.
If you disconnect the Event ActorBeginOverlap node’s exec pin from the Cast To Character node, but keep the Other Actor pin connected, nothing will happen since the exec pins are not connected — meaning that the Event node does not trigger the Cast To Character node.
You can remove the connection between two nodes by using the shortcut ALT + Left Click. Create a new connection by dragging from one pin to another. Pins can only connect if their data types are compatible.
Add Comments to a Blueprint
You can add comments into your Blueprints to create visual-only notes that group nodes together and explain what each part of the Blueprint does. Comments help you and your team members know at a glance what functionality your nodes are performing and keep your Blueprints organized.
When building Blueprint logic, first focus on creating the functionality, and then highlight the nodes you have added and add a comment to contain and describe them.
To add a comment in a Blueprint, follow these steps:
Click the graph to ensure it's the active panel.
Press C on your keyboard. This adds a comment box.
Double-click the text field at the top of the box to enter a comment.
To resize the comment, ensure the comment is selected (highlighted with a yellow outline), and drag an edge or corner.
To group notes within a comment, drag those nodes inside the bounds of the comment.
You can also select one or multiple nodes and press C to add a comment that contains the selected nodes.
Using Variables to Store Blueprint Information
A Blueprint can have variables. A variable is a container that holds a value, like a number for the movement speed of the player, a reference to the static mesh that an asset uses, how many trees there are in a level, and more. Blueprints can use these values while executing functionality.
Look at the My Blueprint panel on the left side of the blueprint editor.
Under the Variables section, you can see two variables: Velocity and Color Target. Click the Velocity variable to select it. In the Details panel, you can now see various properties related to this variable. At the very bottom of the list, you will see the Default Value category, where Velocity is a parameter that can be changed.
In this case, Velocity is set to 0, 0, 800. This means that the velocity that’s applied to the player is 800 units in the Z axis, which means upwards. So, the jump pad’s functionality takes the Velocity variable into account and says “when the player walks over this jump pad, move them upwards at 800 cm/second.”
If you look at the jump pad’s variables, you’ll see they have open Eye icons next to them. This means that these variables are public and editable variables, which makes them editable on all instances of that Blueprint in your level.
To see an example of how variables can be edited outside of a Blueprint, follow these steps:
Click your level’s tab near the top-left corner of Unreal Editor to go back to the Level Editor.
Open the Content Browser and, in the JumpPad folder, drag the
BP_JumpPadasset into the level to a desired location. Make sure it’s selected.In the Details panel, find the category named Default. Under this category, you can see the two variables you saw earlier — Velocity and Color Target. These are visible here since these two variables are listed as public.
Go back to the
BP_JumpPadtab. Under the My Blueprint > Variables section, click on the Eye icon of the Velocity variable to make it not editable. The open eye changes to a closed eye.To apply your changes, click the Compile button on the top-left corner of the Blueprint Editor window.
Compiling checks your Blueprint for errors and updates it so the latest changes work in your level.
Go back to the Level Editor, select the BP_JumpPad actor, and look under the Details > Default section again. The Velocity variable is missing because it’s no longer instance editable.
Go back to the Blueprint Editor and click the Eye icon next to the Velocity variable again.
Save and Compile the Blueprint.
When variables are public and editable, they can also be used by other Blueprints. For instance, in the player character Blueprint, you could detect collisions between the player and jump pad, and then read or change the jump pad’s Velocity from within the character’s event graph. If the variable is not set to public and editable, this isn’t possible.
For more information about the Blueprints system, see Blueprints Visual Scripting.
Using Blueprints to Make a Puzzle Game
You can use the Design a Puzzle Adventure set of tutorial documentation to use Blueprints to build a functional 3D puzzle solving platforming game.
Design a Puzzle Adventure
Learn how to design a full level and gameplay loop in this getting started tutorial!