# Non-executing Macro: Why doesn't this work?

**URL:** <https://forums.unrealengine.com/t/non-executing-macro-why-doesnt-this-work/2395513>\
**Category:** Blueprint\
**Tags:** macros, unreal-engine, Blueprint, question\
**Created:** [March 17, 2025, 10:18am UTC](https://forums.unrealengine.com/t/non-executing-macro-why-doesnt-this-work/2395513 "2025-03-17T10:18:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Virtuality](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/virtuality/32/1140891_2.png) [@Virtuality](https://forums.unrealengine.com/u/Virtuality)\
**Post date:** [March 17, 2025, 10:18am UTC](https://forums.unrealengine.com/t/non-executing-macro-why-doesnt-this-work/2395513/1 "2025-03-17T10:18:10Z")

</div>

Apologies for the minimal description, not sure how to put it better in the title.

Anyway, I’m trying to get a better grip on why some things work in Function, but not in Macro.

The goal is to make a simple generic “Next” Macro, where you can input a wildcard Array and Current position, and it returns the “Next” (going back to 0 after reaching the end) element.

So far I came up with this, but it always returns ‘1’:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/3/013b1cc3eb8beeb97bbe21ed5510f8aea2175680.png)

Any suggestions?

---

<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:** [March 17, 2025, 10:19am UTC](https://forums.unrealengine.com/t/non-executing-macro-why-doesnt-this-work/2395513/2 "2025-03-17T10:19:59Z")

</div>

You need the execution pin ( in and out ).

---

<div class="post-metadata">

**Author:** ![Virtuality](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/virtuality/32/1140891_2.png) [@Virtuality](https://forums.unrealengine.com/u/Virtuality)\
**Post date:** [March 17, 2025, 10:25am UTC](https://forums.unrealengine.com/t/non-executing-macro-why-doesnt-this-work/2395513/3 "2025-03-17T10:25:23Z")

</div>

> [@ClockworkOcean](#):
>
> ecution pin (

I’m trying to keep it ‘pure’. That’s not possible?

---

<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:** [March 17, 2025, 10:44am UTC](https://forums.unrealengine.com/t/non-executing-macro-why-doesnt-this-work/2395513/4 "2025-03-17T10:44:40Z")

</div>

You’re getting macros mixed up with functions 🙂

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [March 17, 2025, 10:58am UTC](https://forums.unrealengine.com/t/non-executing-macro-why-doesnt-this-work/2395513/5 "2025-03-17T10:58:54Z")

</div>

Macros are dirty, they cannot be purified.

For such cthulu spaghettin connections, I do sequence at macro/function entry. Then i store proper result in varible, and feed it to return node at sequence. Makes less off a mess. Also if you can use function use it not macro.

For your macro it would be nicer if you calculated index and that bool value, then just returned results of get. So you could calculate index, store it in variable, then calculate bool value, then got what is in array. with pure function, and using array from input param this could be much more versalite

Or you could use “chooser” (google those for unreal) but chooser would be overkill here. Just gool old boolean algebra of ands xors, ors and nots.

---

<div class="post-metadata">

**Author:** ![Virtuality](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/virtuality/32/1140891_2.png) [@Virtuality](https://forums.unrealengine.com/u/Virtuality)\
**Post date:** [March 17, 2025, 3:55pm UTC](https://forums.unrealengine.com/t/non-executing-macro-why-doesnt-this-work/2395513/6 "2025-03-17T15:55:08Z")

</div>

You’re right… I had to use the execution pins.

Funny detail: Without execution pins UE became very unstable and crashed several times trying to read from (what I assume is a) null pointer.

Thanks anyway for confirming that this is the way to go.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [April 16, 2025, 3:55pm UTC](https://forums.unrealengine.com/t/non-executing-macro-why-doesnt-this-work/2395513/7 "2025-04-16T15:55:59Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
