Course contentsShow
← Unreal Engine Game Development
Lesson 218 of 8803. C++ and UObject ArchitectureFree lesson

Exposing C++ Logic via UFUNCTION Specifiers

Learners will implement BlueprintCallable and BlueprintImplementableEvent macros to bridge C++ game logic with the visual scripting environment for designers.

In this lesson, you will learn how to bridge C++ game logic and the visual scripting environment using BlueprintCallable and BlueprintImplementableEvent.

In Unreal Engine, your C++ code is often the "engine" driving the game, but designers frequently need to control or react to that logic within Blueprints. We use UFUNCTION specifiers to act as a bridge between these two worlds.

BlueprintCallable

When you mark a function as BlueprintCallable, you are telling the engine, "This C++ function is ready for designers to drag and drop into their Event Graphs." It allows a designer to call your code—like a DamagePlayer() or ResetScore() function—whenever their logic dictates.

UFUNCTION(BlueprintCallable, Category = "Game Logic")
void TriggerGameWin();

BlueprintImplementableEvent

Sometimes, you want the C++ code to define when something happens, but let Blueprints define what happens. By using BlueprintImplementableEvent, you declare a function in your header file without providing a C++ body. Instead, the designer implements the logic inside their Blueprint editor.

// Header file
UFUNCTION(BlueprintImplementableEvent, Category = "Events")
void OnPlayerLeveledUp();

When you call OnPlayerLeveledUp() from C++, the engine automatically looks for an implementation inside the Blueprint associated with that class. If the designer has created an event node for it, their visual logic will execute. This is perfect for cosmetic effects, UI updates, or level-specific tweaks that you don't want to hard-code into your C++ foundation.

By strategically choosing between these two, you create a robust workflow: BlueprintCallable allows Blueprints to consume your C++ services, while BlueprintImplementableEvent allows Blueprints to extend your C++ framework. You maintain the high performance of C++ while giving your design team the flexibility they need to iterate quickly.

Key Takeaway: Use BlueprintCallable to let Blueprints trigger your C++ logic, and BlueprintImplementableEvent to let C++ trigger customizable logic inside Blueprints.