Skip to content

Getting started with blueprints

Posted on:September 27, 2023 at 05:05 AM

If you’re a programmer diving into the world of Unreal Engine, you might be wondering how Blueprints fit into your existing knowledge of coding.

Blueprints are Unreal Engine’s visual scripting system, designed to be accessible to artists but powerful enough for full gameplay logic.

In this post, I’ll share my approach to understanding Blueprints from programmer’s point of view.

What Are Blueprints?

Blueprints are Unreal Engine’s way to avoid writing code while implementing game logic.

They are essentially a way to create new classes in Unreal Engine, akin to writing classes in C++ but in a more visual manner. Blueprints can be used for a wide range of tasks, including object manipulation, AI behavior, and even complex gameplay mechanics.

Why Use Blueprints?

Rapid Prototyping

One of the most significant advantages of using Blueprints is the speed at which you can prototype game mechanics. Unlike traditional coding, where you’d need to compile your code to see changes, Blueprints are compiled on the fly, allowing for real-time adjustments.

Collaboration

Blueprints make it easier for non-programmers on your team to understand game logic, making the development process more collaborative. And while as an indie developer I don’t exactly use this benefit of blueprints, it’s good to keep in mind for the future.

Debugging

The visual nature of Blueprints makes debugging more intuitive. You can easily trace the flow of game logic, set breakpoints, and even watch variable changes in real-time.

Blueprint usage foundation

The key terms to keep in mind

  1. Blueprints themselves. Think of it as a class.
  2. Nodes. Those represent functions.
  3. Connections. Those are establishing relations between nodes. For example, a value node could be connected to the input field of a function node.

Instantiating

If a blueprint is a class, then how could the object of this class be created?

Generally, there are two ways:

  1. By dragging the Blueprint to editor. While editor shows a specific level of the game, dragging the Blueprint file into it will create the object of “Blueprint class”. Most of the time, Blueprint derives from AActor class and has some sort of visual representation. Blueprints without visual representation are deriving from UObject and could be used the same way.
  2. By calling SpawnActorFromClass. This call could be made either from C++ file or from another Blueprint as a node.

Getting Started with Blueprints

Let’s explore how to create the Blueprint and what are the available nodes for further implementation.

Creating a New Blueprint Class

  1. Open the Content Browser.
  2. Right-click and choose Create -> Blueprint Class.
  3. Select the parent class, usually Actor, Pawn, Character, or GameMode, depending on your needs.
  4. Name your Blueprint and double-click to open it.

Basic Blueprint Nodes for Programmers

Variables

Work with variables boils down to working with getter and setter methods.

Functions

All other functions are also defined by nodes.

Control Flow

Conclusion

Blueprints in Unreal Engine offer a powerful visual way to implement game logic, making it a convenient tool for both programmers and non-programmers alike. With this brief, you should have a basic understanding of how to approach Blueprints as a programmer.

Further reading

  1. Blueprints Visual Scripting dicumentation
  2. AActor documentation
  3. UObject documentation
  4. Spawn Actor From Class

P.S.: I hope this blog post helps you in your gamedev journey! Feel free to share your thoughts and questions in the comments on social media or DMs. Happy coding! 🎮💻