Reader small image

You're reading from  Blueprints Visual Scripting for Unreal Engine 5 - Third Edition

Product typeBook
Published inMay 2022
Reading LevelBeginner
PublisherPackt
ISBN-139781801811583
Edition3rd Edition
Languages
Tools
Right arrow
Authors (2):
Marcos Romero
Marcos Romero
author image
Marcos Romero

Marcos Romero is the author of the Romero Blueprints blog, which is one of the main references on the internet to learn about Blueprints. Epic Games invited Marcos to the Unreal Engine 4 closed beta program to experiment and collaborate with the evolution of the tools. He was also one of the first recipients of Unreal Dev Grants for Education. Marcos is a well-known figure in the Unreal community and, for Epic Games, he wrote the official Blueprints Compendium and Blueprints Instructor's Guide.
Read more about Marcos Romero

Brenden Sewell
Brenden Sewell
author image
Brenden Sewell

Brenden Sewell is a game designer and creative director with over a decade of experience leading teams in the development of compelling interactive experiences that entertain and inspire. Prior to joining Bossfight Entertainment to work on some upcoming secret projects, he explored the intersection of social impact and entertainment serving as the Creative Director for E-line Media. He has led developments from concept to live support on a variety of games ranging from a brain-training first-person shooter to a construction sandbox exploring the future of digital fabrication.
Read more about Brenden Sewell

View More author details
Right arrow

Chapter 15: Blueprints Tips

This chapter contains several tips on how to improve the quality of Blueprints. We will learn how to use various editor shortcuts that speed up our work. We will also learn about some Blueprint best practices that will help you to decide what type of implementation should be done and where. Finally, we'll learn about more useful miscellaneous Blueprint nodes.

These are the topics covered in this chapter:

  • Blueprint Editor shortcuts
  • Blueprint best practices
  • Using miscellaneous Blueprint nodes

By the end of the chapter, you will be familiar with shortcuts, best practices, and Blueprint nodes that will help you when developing more complex games.

Blueprint Editor shortcuts

In the Blueprint Editor, we are going to work with variables a lot, so let's start with the shortcuts related to variables.

When you drag a variable from the My Blueprint panel and drop it in EventGraph, a submenu appears for you to choose either the GET or SET nodes. However, there are shortcuts to create GET and SET nodes. If you hold the Ctrl key and drag a variable to the graph, then the editor will create a GET node. To create a SET node, hold the Alt key and drag a variable to the graph. The following screenshot shows the GET and SET nodes:

Figure 15.1 – Shortcuts to create GET and SET nodes

There is another way to create GET and SET nodes. If you drag a variable and drop it on a compatible pin of another node, then the editor will create a GET or SET node depending on the parameter type.

The following screenshot shows an example of the Score variable being dropped on an input parameter pin. If the pin is...

Blueprint best practices

In a project, you will deal with several Blueprint classes, and some of these Blueprint classes will be complex, with many nodes. The tips in this section will help you analyze your project and carry out some practices that will make your Blueprint classes more manageable. I separated these tips into two categories: Blueprint responsibilities and Blueprint complexities.

Blueprint responsibilities

When creating a Blueprint, you need to decide what its responsibilities will be. This refers to what it will do and what it will not do. You need to make the Blueprint as independent as possible. A Blueprint must be responsible for its internal state.

To illustrate the concept of Blueprint responsibilities, let's work with a simple example created for teaching purposes. In a game, the player is represented by the FirstPersonCharacter Blueprint. If the player collides with an enemy Blueprint, then the player will die, and an explosion effect will be spawned...

Using miscellaneous Blueprint nodes

In this section, we will learn about some Blueprint nodes that can be very useful in certain situations.

These are the nodes covered in this section:

  • Select
  • Teleport
  • Format Text
  • Math Expression
  • Set View Target with Blend
  • AttachActorToComponent
  • Enable Input and Disable Input
  • The Set Input Mode nodes

Select

The Select node is very flexible. It can work with several types of variables for the index and the values of options. The node returns a value associated with the option that corresponds to the index that is passed as input. The following screenshot shows the Select node:

Figure 15.28 – The Select node

To add more input option pins, click on Add pin +. You can set a pin type of Option 0, Option 1, or Index by dragging a variable reference or wire onto the pins. Option 0 and Option 1 can be of any type, but the Index type must be Integer, Enum, Boolean, or Byte...

Summary

In this chapter, we saw how to use editor shortcuts to create variables in various ways and how to organize Blueprint nodes using alignment tools. We also learned about some shortcut keys that are used to create specific Blueprint nodes.

Then, we looked at some Blueprint best practices to define Blueprint responsibilities and manage the complexities of Blueprints.

Finally, we learned about some more useful Blueprint nodes. All of these tips will help you to improve your scripts and build quality projects.

In the next chapter, we will explore the virtual reality template that is available in the Unreal Engine Editor.

Quiz

  1. To create a GET node, hold the Alt key and drag a variable to the graph.

a. True

b. False

  1. A Blueprint must be responsible for its internal state and be as independent as possible.

a. True

b. False

  1. You can select a group of nodes and convert them into a collapsed graph, Function, or Macro.

a. True

b. False

  1. The Index parameter of the Select node can be of any type.

a. True

b. False

  1. The Math Expression node creates an input parameter pin for each variable name found in the expression.

a. True

b. False

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition
Published in: May 2022Publisher: PacktISBN-13: 9781801811583
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Marcos Romero

Marcos Romero is the author of the Romero Blueprints blog, which is one of the main references on the internet to learn about Blueprints. Epic Games invited Marcos to the Unreal Engine 4 closed beta program to experiment and collaborate with the evolution of the tools. He was also one of the first recipients of Unreal Dev Grants for Education. Marcos is a well-known figure in the Unreal community and, for Epic Games, he wrote the official Blueprints Compendium and Blueprints Instructor's Guide.
Read more about Marcos Romero

author image
Brenden Sewell

Brenden Sewell is a game designer and creative director with over a decade of experience leading teams in the development of compelling interactive experiences that entertain and inspire. Prior to joining Bossfight Entertainment to work on some upcoming secret projects, he explored the intersection of social impact and entertainment serving as the Creative Director for E-line Media. He has led developments from concept to live support on a variety of games ranging from a brain-training first-person shooter to a construction sandbox exploring the future of digital fabrication.
Read more about Brenden Sewell