Blueprints Visual Scripting
Blueprints is UE5's node-based visual scripting system. Build complete gameplay systems, UI, tools, and interactions without writing a single line of C++ code.
Blueprint Types
UE5 supports several kinds of Blueprint assets, each suited to different tasks:
| Type | Description | Common Use |
|---|---|---|
| Blueprint Class | Extends any C++ or Blueprint class. Contains components, variables, and graphs. | Characters, enemies, weapons, pickups, doors |
| Level Blueprint | Per-level script. Has access to all actors in that level. | Level-specific events, cutscene triggers |
| Blueprint Interface | Defines functions any Blueprint can implement. Enables polymorphism. | Interactable interface, damage interface |
| Blueprint Macro Library | Reusable macro subgraphs shared across Blueprints. | Utility macros, debug helpers |
| Blueprint Function Library | Static pure functions accessible from any Blueprint. | Math helpers, game utilities |
| Animation Blueprint | Specialised Blueprint for driving skeletal mesh animations via state machines. | Character animation, procedural IK |
Event Graph
The Event Graph is the main execution graph of a Blueprint Class. Execution begins at Event nodes (red header) and flows left-to-right through function call nodes connected by execution wires (white lines). Data flows through typed pins (colored lines).
Common Built-in Events
Event BeginPlay— Fires once when the game starts or the actor is spawned.Event Tick— Fires every frame. Delta Seconds output gives the frame time.Event EndPlay— Fires when the actor is destroyed.Event ActorBeginOverlap— Fires when another actor enters an overlap volume.Event Hit— Fires on a physics collision hit.Event AnyDamage— Fires when the actor receives any damage.
Variables
Variables store data in a Blueprint. They are created in the My Blueprint panel and can be exposed to the Details panel for per-instance editing via Instance Editable and to other Blueprints via BlueprintReadWrite.
| Type | Pin Color | Examples |
|---|---|---|
| Boolean | ■ Red | bIsAlive, bCanJump |
| Integer | ■ Cyan | Health, Score, Level |
| Float | ■ Green | Speed, JumpHeight |
| String | ■ Magenta | PlayerName |
| Vector | ■ Yellow | SpawnLocation, Velocity |
| Rotator | ■ Sky Blue | InitialRotation |
| Object Reference | ■ Purple | TargetActor, PlayerRef |
| Struct | ■ Tan | FHitResult, FTimerHandle |
Functions & Macros
Functions are reusable subgraphs with input/output parameters. They execute synchronously and compile to a single function call. Functions can be Pure (no execution wire, no side effects) or Impure (execution wire required).
Macros are similar but are inlined at compile time. They support multiple execution inputs/outputs (useful for branch-like behavior) but cannot be overridden or called from C++.
Prefer Functions over Macros when possible — functions appear in the call stack for easier debugging, can be overridden in child Blueprints, and integrate with C++ via BlueprintImplementableEvent.
Blueprint Casting
Casting converts an object reference from a base type to a more derived type, granting access to child-specific variables and functions. Use a Cast To node:
// Retrieve the player character and access a custom variable
Get Player Character → Cast To BP_MyCharacter
Success → As BP_My Character → Get Health → Print String
Fail → (handle failure — target is not BP_MyCharacter)
Casting to a Blueprint class forces that class to always load. For loose coupling, prefer Blueprint Interfaces instead of direct casts.
Timers & Delays
The Set Timer by Function Name or Set Timer by Event nodes schedule delayed or repeating function calls without blocking the frame. The Delay node creates a latent action — execution pauses on that node but the rest of the engine continues running.
Blueprint Communication
Three primary patterns for Blueprints to communicate with each other:
- Direct Reference — Store a reference to another actor and call its functions directly. Simple but creates tight coupling.
- Blueprint Interface — Call a message on any actor. If it implements the interface, the function runs. Loose coupling, no cast needed.
- Event Dispatchers — A publisher/subscriber pattern. Blueprints bind to a dispatcher and receive notifications when it fires. Ideal for UI updates.