Add Global Functions To Blueprints In Seconds!

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?

Perfect for string helpers, math functions, data converters, or custom utilities you’ll want everywhere.


2) Creating the Blueprint Function Library

  1. In the Unreal Editor, go to Tools → New C++ Class.
  2. In the wizard, switch to All Classes tab.
  3. Search for Blueprint Function Library and select it.
  4. Click Next, keep the default file name (e.g., MyBlueprintFunctionLibrary).
  5. 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:


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

  1. In Unreal, open Level Blueprint.

  2. Add an Input Key node (e.g., W).

  3. Right-click, search for Rambod Dev → Utility → String.

  4. Drag Reverse Words onto the graph.

  5. Connect:

    • Input "Hello World" → Reverse Words
    • Output → Print String node
    • Execution: W pressed → Reverse Words → Print String

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


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 like RemoveExtraSpaces and ReverseWords. Mark them BlueprintPure, static, and organize them under a category. Implement logic in C++ with loops, trimming, and Algo::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:

👉 Watch the full tutorial: YouTube Link 👉 Docs: Unreal Engine Function Library 👉 Subscribe for more: Rambod Dev Channel