Blueprints

About

← Back

Formatting

Blueprint Style Guide

Annotations

Standalone Comment

Create a reroute node and add comment to create a standalone comment note in Blueprints.

image

Node can be repositioned in graph.

Pin

This refers to the pin at the top right corner of the comment box. Horizontal position preserves original text size in comment regardless of zoom, and angled position matches scale of text with zoom level.

Keyboard Shortcuts

NameShortcut
Word wrap (in BP)

SHIFT + ENTER

Color-Coding Comments

Color code comments to provide visual clarity among events and other operations throughout BPs. The following is a simple guide

  • Blue: Begin Play
  • Red: Debug Operations

DOP

DOP : Disconnected On Purpose

Include this comment on any instance where a BP node input/output is disconnected to track workflow.

Shortcuts

Variables To Graph

Select variable from My Blueprint panel and RMB drag into Graph with:

  • CTRL: Get variable
  • ALT: Set variable

Nodes

To access all available nodes, disable Context Sensitive from new node panel.

Action Context

Selecting a component and then accessing available actions with Context Sensitive enabled provides quick access to available actions specific to the selected component.

image

Production

Blueprint Types

Level Blueprint

Only gets executed within its corresponding level.

Can reference multiple actors within its level.

No components can be added; thus no viewport within this BP.

Events within this BP are bound to specified level and cannot be instantiated.

Can interact and communicate with actors in level.

Actor Blueprint

More modular than level BP; can be used in various levels and instantiated multiple times within a level.

Separate entity for independent functionality.

Can be enacted at beginning of play or with specific triggers.

Can be instantiated throughout level, with the potential of each instance acting independent of each other.

Pawn BP

Playable character functionality.

Animation BP

Event Graph

Used to control logic for animations and user control at runtime.

Anim Graph

Allows for coordinating animation states, blending, etc.

Player Controller

Emphasizes user interactivity and controls during game play.

Game Mode

Set of rules specified for the game play.

UMG UI BP

Used for creating UI elements at runtime.

Widget BP

Does not include a Components section, but instead uses a Designer workspace.

Child BP

Relies on a Parent BP that is typically set up as an Actor BP.

Inherits all functionality from Parent BP.

Created by RMB on a BP and selecting Create Child Blueprint Class.

Blueprint Function Library

Collection of functions that can be accessed from other BPs

Blueprint Interface

Communication amongst BPs

Create functions within and then access them via Class Settings in other BPs.

Class Settings > Interfaces > Implemented Interfaces > Add

Once they are accessible, the available functions should be available under the My Blueprint panel in the current BP > Interfaces.

Blueprint Macro Library

Collection of macros that can be used in various BPs

Enumeration

Named list

Structure

Collection of different variable types

Blueprint Sections

Construction Script

  • Executes when actor is placed in editor and whenever modifications are made to the actor, as well as in runtime when the game begins.
  • This is suitable for allowing edits to be made within the Editor by artists, level designers, etc.

Event Graph

  • Scripting for actions to be executed during runtime.

Function

  • Collection of nodes for organizational and use in various instances.
  • Allows for inputs to be processed into the Function, unlike a Macro.
  • Can be created by selecting nodes and collapsing.

Macros

  • Similar to Function, but with some differences in functionality.
  • These are utility tools.
  • Sim to Function, can be created by selecting nodes and collapsing.

Collapsed Graph

  • Simply groups collection of nodes in a condensed format.
  • Sim to Function, can be created by selecting nodes and collapsing.
  • Unlike Functions and Macros, these can be used in various instances.

Event Dispatchers

  • Communication tool among BPs and other facets of UE.

Variables

Data Types

  • Boolean, Integer, Float, Vector, String
  • Transform: Position, Rotation, Scale
  • Blueprint Objects

Note the colored inputs in Blueprint nodes are coordinated with the various data types available to be used.

Accessibility & Visibility

Make public and accessible by other BPs by enabling the following detail parameters:

  • Instance Editable
    • This correlates with the eyelid icon going from closed to open at the variable section of the My Blueprint panel.
  • Expose on Spawn

Tooltip

Adding a tooltip to a variable changes eye icon color from yellow to green.

Convert from String to Array

RMB over variable to toggle between string and array

Game Mode Setup

Default GameMode: Setup a new one for game to enable Class options.

Default Pawn Class: Defines the player character to be viewed during game play. Verify this is setup rather than default sphere shape.

Components

Default Scene Root

This is the white sphere that appears within a BP.

It serves as the parent for all of the other components within the BP.

Any other component can replace the 'white sphere' and serve as the Scene Root.

Drag the intended component to the Default Scene Root and it will replace the 'white sphere' and now serve as the Scene Root.

Billboard Component

2D sprite that is oriented towards camera.

Movement

Rotation rate is in degrees per second (Example: 180 degrees/second).

Bindings

These are checked every frame and can link a variable to another element. For instance, a variable's value from a function can drive a progress bar's growth in a UI element.

Bindings are executed on each tick.

Example: Health bar UI element does not need to check each tick. Instead check only in the Event when player receives damage.

Progress bar goes from 0 - 1.

Example: If health value is from 0 -100, then divide it by 100 to fit it to range of 0 - 1. This is the same as using Map Range Clamped and going from 0 - 100 to 0 - 1.

Performance

BPs rely on references, which can be viewed through RMB > Size Map and RMB > Reference Viewer.

As such, the BP and its references can heavily impact what is loaded into memory, so only load a BP when needed.

Monitor and manage instances of casting throughout script.

To minimize impact, soft-load assets with Async Load Asset node rather than hard references (i.e. Set Static Mesh, etc.).

Async Load Asset loads the asset only when needed and when the node is executed.

Utilize C++ bridge to BP can enhance performance.

Blueprint Function Library

Cast from transient actor to ever-present actor rather than vice versa.

Example: A player character is always present in the game whereas the enemy actor is only present when the player is in proximity of it. Therefore it is better to cast from the enemy actor to the player actor, which is already in memory,

Performance Intensive Nodes/Operations

While Loop

For Each Loop

Do N

Get All Actors Of Class

Ticking & Timers

Tick default off for BPs

Use dumpticks command in console to get list of all instances of tick operations.

Collaboration

BPs are binary files.

Split functionality to allow for multiple collaborators.

Integrated diff tool should not be part of typical workflow

Errors

Use Is Valid to confirm reference is legitimate before executing.

Keep track of references when attempting to remove or deprecate.

Debugging

Blueprint Watcher

In game mode, have BP Event Graph open to view simulation of the BP. In this way, the values streaming between nodes can also be viewed and monitored.

Breakpoints can be also be enabled through graph.

Editor Utilities

Verify Call In Editor is enabled for function to be accessible from Editor.

image

Add Component

UMG

Button Event Triggers

  • Pressed
    • Event triggered when mouse button is depressed.
  • Released
    • Event triggered after mouse button has been released.
    • Requires mouse button to start in a pressed state.
  • Clicked
    • Event triggered when mouse button is pressed and released, in succession.

Mouse Wheel Up/Down

In this case, Pressed means scrolling the mouse wheel up or down.

Operations

Blueprint Communication

Casting

Used to check if an actor is a specific type of actor or not.

Allows for communicating among BPs.

Interfaces

More efficient way of communicating among BPs without having to cast.

Event Dispatcher

Commonly used to link between Actor BPs and the Level BP.

'IsValid' Check

Use IsValid to check if pawn is outputting a return value before moving into code in EventGraph of an animBP.

Pause/Unpause Game

  • Define key/ctrl in Project Settings
  • Add Input Action to level BP
    • Enable 'Execute when Paused' in Details. This allows for the key to be usable to unpause the game. Without this, the game will not unpause.
  • Use Flip/Flop node to pause/unpause
  • Path A to Paused (True) and B to Paused (False)

Blueprints vs C++

BP

Avoid complex math and heavy operations on every frame

BP is translated to C++ via virtual machine

BP is event-based

References

BPs rely on references

Errors may result if references are not correctly configured to actual objects that can be referenced.

Circular Dependencies

BPs that rely on other BPs, which may have dependencies within original BP.

C++

Faster than BPs

Resources

Resources

Keyboard Shortcuts

Keyboard Shortcuts

NameShortcutNotes
Disable node

RMB node > Disable

To enable feature: Editor Preferences > Allow Explicit Impure Node Disabling

Rename node

Select node + F2

Add component to graph

CTRL + LMB drag component from panel to graph

This creates a Get node.

Add variable to graph

ALT + LMB drag variable from panel to graph

This creates a Set node.

Create branch

B + LMB

Node info

CTRL + ALT while hovering over node

Word wrap (in BP)

SHIFT + ENTER

Add comment panel

C or select nodes + C

This creates a panel to encapsulate selected nodes.

Reroute Node

Double Click to insert

Break Connection

ALT + LMB

Reroute Connection

CTRL + LMB

Pan

LMB Drag

Marquee Select

RMB Drag

Texture Sample

T

Context: Shader