
Add Global Functions To Blueprints In Seconds!
Create a Blueprint Function Library in C++ to add global utility nodes instantly in UE5. No actors, no duplication—just clean reusable functions.
This is Rambod, and in this tutorial you’ll learn how to create static utility functions in C++ that become instantly available as Blueprint nodes across your entire Unreal project.
No extra setup, no actor classes, no copy-pasting logic. Just one library of clean functions you can call from anywhere.
By the end, you’ll know how to:
✅ Create a BlueprintFunctionLibrary
in C++
✅ Write reusable static methods with UFUNCTION
✅ Organize them with categories for easy discovery
✅ Test new nodes directly in Level Blueprints
✅ Build a clean global utility workflow for any project
1) Why Global Blueprint Functions?
- Reusable → avoid duplicating the same node logic in multiple Blueprints.
- Lightweight → no inheritance or base class required.
- Fast Setup → one C++ library = global access.
- Organized → place your nodes under custom categories like Rambod Dev → Utility → String.
Perfect for string helpers, math functions, data converters, or custom utilities you’ll want everywhere.
2) Creating the Blueprint Function Library
- In the Unreal Editor, go to Tools → New C++ Class.
- In the wizard, switch to All Classes tab.
- Search for Blueprint Function Library and select it.
- Click Next, keep the default file name (e.g.,
MyBlueprintFunctionLibrary
). - Press Create.
Unreal generates the .h
(header) and .cpp
(source) files and compiles them.
When the compile finishes, your IDE (Rider, VS, Xcode, etc.) opens with the new empty class stub.
3) Writing the First Utility Function
Open the header file. Inside the public:
section, add your first static function:
UFUNCTION(BlueprintPure, Category="Rambod Dev|Utility|String")
static FString RemoveExtraSpaces(const FString& InputString);
Breaking this down:
UFUNCTION
→ exposes the function to Blueprints.BlueprintPure
→ function won’t change game state (purple node, no exec pins).Category
→ organizes where the node shows up.static
→ no instance needed; function belongs to the class itself.FString
return type → UE’s string class.- Parameter:
const FString&
→ efficient input string reference.
4) Adding a Second Function (Reverse Words)
Right below, declare another function:
/** Reverses the order of words in a string */
UFUNCTION(BlueprintPure, Category="Rambod Dev|Utility|String")
static FString ReverseWords(const FString& InputString);
This one flips the order of words in the given string. The comment becomes a tooltip in Blueprint.
5) Implementing Functions in CPP
Switch to the .cpp
file. At the top, include:
#include "Algo/Reverse.h"
Remove Extra Spaces
FString UMyBlueprintFunctionLibrary::RemoveExtraSpaces(const FString& InputString)
{
FString Cleaned;
bool bLastWasSpace = true;
for (TCHAR Ch : InputString)
{
if (FChar::IsWhitespace(Ch))
{
if (!bLastWasSpace)
{
Cleaned.AppendChar(TEXT(' '));
bLastWasSpace = true;
}
}
else
{
Cleaned.AppendChar(Ch);
bLastWasSpace = false;
}
}
Cleaned.TrimStartAndEndInline();
return Cleaned;
}
Reverse Words
FString UMyBlueprintFunctionLibrary::ReverseWords(const FString& InputString)
{
FString Clean = RemoveExtraSpaces(InputString);
TArray<FString> Words;
Clean.ParseIntoArray(Words, TEXT(" "), true);
Algo::Reverse(Words);
return FString::Join(Words, TEXT(" "));
}
Save, Build Project. If no errors → your functions are now available as global Blueprint nodes.
6) Testing in the Level Blueprint
-
In Unreal, open Level Blueprint.
-
Add an Input Key node (e.g.,
W
). -
Right-click, search for Rambod Dev → Utility → String.
-
Drag Reverse Words onto the graph.
-
Connect:
- Input
"Hello World"
→ Reverse Words - Output → Print String node
- Execution:
W
pressed → Reverse Words → Print String
- Input
Compile & Play.
When pressing W, "World Hello"
prints to screen.
🎉 You’ve just confirmed your static C++ function is globally accessible.
7) Why This Workflow Rocks
-
Functions are instantly usable in all Blueprints.
-
No need for Actor components, parent classes, or object references.
-
Organize helpers cleanly by categories.
-
Ideal for:
- String utilities (trim, split, format)
- Math helpers
- Data conversion functions
- Any utility logic reused across multiple systems
Subtitle Expansion (Tutorial Flow)
“This is Rambod. We’re adding global Blueprint functions in seconds. Open the class wizard → choose Blueprint Function Library → create files. Add static
UFUNCTION
methods likeRemoveExtraSpaces
andReverseWords
. Mark them BlueprintPure, static, and organize them under a category. Implement logic in C++ with loops, trimming, andAlgo::Reverse
for word order. Build project, open Level Blueprint, and test by wiring functions to a key input and Print String. Now your functions are available globally in any Blueprint, no actor setup required.”
Wrap-Up
We built a Blueprint Function Library that gives you global utility nodes in seconds:
- Create a C++
BlueprintFunctionLibrary
- Add static
UFUNCTION(BlueprintPure)
methods - Organize them with custom categories
- Compile once → available everywhere
- Test directly in Level Blueprint
👉 Watch the full tutorial: YouTube Link 👉 Docs: Unreal Engine Function Library 👉 Subscribe for more: Rambod Dev Channel