# \[Bug Report\] ForEachLoop can't read from an array of wildcards inside a macro library!!

**URL:** <https://forums.unrealengine.com/t/bug-report-foreachloop-cant-read-from-an-array-of-wildcards-inside-a-macro-library/395120>\
**Category:** Audio\
**Tags:** macro-library, unreal-engine, loop, bug-report, UE4, question\
**Created:** [May 31, 2017, 8:07am UTC](https://forums.unrealengine.com/t/bug-report-foreachloop-cant-read-from-an-array-of-wildcards-inside-a-macro-library/395120 "2017-05-31T08:07:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![navid100](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@navid100](https://forums.unrealengine.com/u/navid100)\
**Post date:** [May 31, 2017, 8:07am UTC](https://forums.unrealengine.com/t/bug-report-foreachloop-cant-read-from-an-array-of-wildcards-inside-a-macro-library/395120/1 "2017-05-31T08:07:57Z")

</div>

Hi guys.

I have created a macro library and put a ‘For Each Loop’ inside it. Then When I create an array of wildcards for the input of my macro library and plug it into the array pin of the loop, I noticed that ‘For Each Loop’ doesn’t read the wild array which I have determined its type outside of the macro. I have tried other array types and it seems the loop inside the macro has no problem in reading from specified arrays. It only can’t read from a wild array, which is so disappointing, because actually I specify the wild array type but just outside of the macro. Here take a look at my pictures. I have created a very simple graph to show you where the bug is.

This is my main graph inside level blueprint.

 ![139852-maingraph.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/c/dbc80850c4a53a6bec69d2ac6ad6ae2b1eeddb6d.png)

This is the Test macro.

 ![139853-mytestmacrolibrary.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/6/e/86e3bdd75806edc972a335e144b67fb029a9a2d4.png)

Random array

![139856-randomarray.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/d/b/cdb9bc30b1086c4e8cc74656d6ad683046fc0e52.png)

For each loop

 ![139854-foreachloop.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/c/2/1c2590d34e893ec0004b763032ec129b2b876188.png)

Compiler results

![139855-compilerresults.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/0/a8075d368b179a48882f1e66c0ad51760d160400.png)

I hope you guys will find a solution soon to this issue.

Regards.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6db033ec](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6db033ec](https://forums.unrealengine.com/u/anonymous_user_6db033ec)\
**Post date:** [May 31, 2017, 10:02am UTC](https://forums.unrealengine.com/t/bug-report-foreachloop-cant-read-from-an-array-of-wildcards-inside-a-macro-library/395120/2 "2017-05-31T10:02:09Z")

</div>

**The problem is Unreal Engine doesn’t let us use Wildcards**

I’ve recreated the macro and got the same problem. The only way I fixed it was to change the parameter from `wildcard` to `integer`. When that happened, the ForEach turned into an integer one, and all was fixed.

When you go to create a variable, you notice that you cannot type in `wildcard` and have it show up. Dragging a wildcard wire into the parameter isn’t going to trick the engine into letting you using it.

The tough reality is you’re probably going to have to make one for integers, floats, vectors, but as far as objects go, you can always cover all your bases and have a foreach for objects.

But just add the foreach’s for each type as you need them, just to prevent making 5,000 macros all at once.  
Its sucky, I know 😕

---

<div class="post-metadata">

**Author:** ![mrlz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mrlz](https://forums.unrealengine.com/u/mrlz)\
**Post date:** [May 31, 2017, 1:24pm UTC](https://forums.unrealengine.com/t/bug-report-foreachloop-cant-read-from-an-array-of-wildcards-inside-a-macro-library/395120/3 "2017-05-31T13:24:48Z")

</div>

I think there’s nothing wrong with macro, ForEachLoop is already a macro, if you try ForEachLoop directly, you won’t get any errors.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d2b909bf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d2b909bf](https://forums.unrealengine.com/u/anonymous_user_d2b909bf)\
**Post date:** [May 31, 2017, 3:02pm UTC](https://forums.unrealengine.com/t/bug-report-foreachloop-cant-read-from-an-array-of-wildcards-inside-a-macro-library/395120/4 "2017-05-31T15:02:14Z")

</div>

Hello Navid100,

I believe the issue you are experiencing is a known issue, which you can view here:

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-21739)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.
