Skip to main content
System decisionBlueprint

Blueprint Function or Macro?

Choose a normal callable function or a graph that expands into each call site.

Blueprint FunctionBlueprint MacroMacro Library

Recommendation

Use a Function by default. Use a Macro when the graph needs macro-only execution flow, such as multiple execution outputs or node expansion.

Compare the options

Function

Choose when

  • Logic has a normal call boundary.
  • Another object or child class may call it.
  • The behavior belongs to the object that defines it.

Tradeoffs

  • Functions follow function graph restrictions.
  • They use a normal call boundary instead of expanding nodes into callers.
Blueprint
Create a Function graph on the Blueprint or in a Blueprint Function Library.
C++
Use a member function or a reflected UFUNCTION.

Macro

Choose when

  • Reusable graph expansion needs multiple execution paths.
  • The node pattern cannot be expressed as a normal function.

Tradeoffs

  • The compiler expands the graph into every call site.
  • A Macro is not a targetable object method.
Blueprint
Create a local Macro or a Blueprint Macro Library.
C++
There is no direct C++ mapping. Blueprint Macros are compiler graph expansion, not a C preprocessor recommendation.

Requirements

Both options are built into Blueprint.

Example

Use a Function for Has Enough Ammo. Use a Macro for an execution helper with Success and Failure output pins.

Epic documentation

Related guides

Unreal Directive is free and ad-free.

If it saved you time, you can help keep it that way.

Donate