# What is a macro and what is it actually used for?

**URL:** <https://forums.unrealengine.com/t/what-is-a-macro-and-what-is-it-actually-used-for/2722398>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [May 15, 2026, 4:56pm UTC](https://forums.unrealengine.com/t/what-is-a-macro-and-what-is-it-actually-used-for/2722398 "2026-05-15T16:56:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EikooGameDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EikooGameDev](https://forums.unrealengine.com/u/EikooGameDev)\
**Post date:** [May 15, 2026, 4:56pm UTC](https://forums.unrealengine.com/t/what-is-a-macro-and-what-is-it-actually-used-for/2722398/1 "2026-05-15T16:56:31Z")

</div>

Hello everyone, I am currently learning blueprint via paid training from Evans Bohl for those who know, and I was wondering what a macro is actually used for and what is the difference with a function?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 15, 2026, 5:44pm UTC](https://forums.unrealengine.com/t/what-is-a-macro-and-what-is-it-actually-used-for/2722398/2 "2026-05-15T17:44:00Z")

</div>

They look very similar on the surface, but there is a fundamental difference: All the macros in your code get replaced by the actual code before the game is run ( just like a text replacement ), whereas only one copy of a function is loaded, and any code that calls it is routed through it at run time.

There are a lot of other differences, for example

1 You can have multiple entry and exit execution pins on macros

2 Functions handle short circuit exiting more gracefully

3 You can write recursive code with functions ( not recommended ), but not macros

4 You can’t have ‘latency’ in functions ( like delay nodes )

5 etc…

I’m sure someone else can chime in.

---

<div class="post-metadata">

**Author:** ![EikooGameDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EikooGameDev](https://forums.unrealengine.com/u/EikooGameDev)\
**Post date:** [May 15, 2026, 6:14pm UTC](https://forums.unrealengine.com/t/what-is-a-macro-and-what-is-it-actually-used-for/2722398/3 "2026-05-15T18:14:50Z")

</div>

Ok thanks, but what are macros actually used for?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 15, 2026, 7:07pm UTC](https://forums.unrealengine.com/t/what-is-a-macro-and-what-is-it-actually-used-for/2722398/4 "2026-05-15T19:07:45Z")

</div>

Making re-usable chunks of code, just like functions 🙂

---

<div class="post-metadata">

**Author:** ![jay001020](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jay001020/32/1194524_2.png) [@jay001020](https://forums.unrealengine.com/u/jay001020)\
**Post date:** [May 15, 2026, 11:54pm UTC](https://forums.unrealengine.com/t/what-is-a-macro-and-what-is-it-actually-used-for/2722398/5 "2026-05-15T23:54:05Z")

</div>

> [@EikooGameDev](#):
>
> Ok thanks, but what are macros actually used for?

They are used for convenience and to make code easier to read. The For Loop, Do Once, and Gate nodes are all macros, you can double click them to open them up and show what they look like. They all have multiple exec/exit pins so they can’t be functions.

---

<div class="post-metadata">

**Author:** ![Anonymous\_867380bcb29bf4a904df1bf4bd50a98f](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/anonymous_867380bcb29bf4a904df1bf4bd50a98f/32/931146_2.png) [@Anonymous\_867380bcb29bf4a904df1bf4bd50a98f](https://forums.unrealengine.com/u/Anonymous_867380bcb29bf4a904df1bf4bd50a98f)\
**Post date:** [May 16, 2026, 6:38am UTC](https://forums.unrealengine.com/t/what-is-a-macro-and-what-is-it-actually-used-for/2722398/6 "2026-05-16T06:38:10Z")

</div>

They are used, amongst other things, for things like UPROPERTY() -which is a macro - etc… that the engine uses to expose variables from your C++ code and make them visible inside the Editor.

Thanks to the arcanery of these macros, we can have our “int x;” typed within the source code showing up as a nice little box inside of the Blueprint Editor, for example.

Note: the convention is to write the whole thing UPPERCASE, so if you see something all capped, that’s likely a macro.

EDIT: just noticed this was under the blueprint section, my bad
