# \[bug?\] find component in array from hit result

**URL:** <https://forums.unrealengine.com/t/bug-find-component-in-array-from-hit-result/367556>\
**Category:** Blueprint\
**Tags:** hit-result, unreal-engine, bug-report, question, Blueprint\
**Created:** [August 18, 2016, 10:24pm UTC](https://forums.unrealengine.com/t/bug-find-component-in-array-from-hit-result/367556 "2016-08-18T22:24:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_ce8ce53d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ce8ce53d](https://forums.unrealengine.com/u/anonymous_user_ce8ce53d)\
**Post date:** [August 18, 2016, 10:24pm UTC](https://forums.unrealengine.com/t/bug-find-component-in-array-from-hit-result/367556/1 "2016-08-18T22:24:52Z")

</div>

I try to find a static mesh component in an array from the “hit component” and it compiles and works perfectly fine with absolutely no problem whatsoever.  
However, after closing and opening the editor again; the same event appears with an error saying: “COMPILER ERROR:” failed building connection with ‘Primitive Component Reference is not compatible with Static Mesh Component Reference (by ref).’

If i just redo the node and compile again it works perfectly fine again.

So… what’s the deal here?

 ![103485-bug.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/0/270278e8353eb0448ce6c84f0a0ca2421cc0742e.png)

I ended up using a separate mirrored “DisplayName” array and it was a successful workaround. But is still weird that it compiles, and then on restarting the editor shows an error and can just be recompiled if the node is redone.

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [August 19, 2016, 6:21pm UTC](https://forums.unrealengine.com/t/bug-find-component-in-array-from-hit-result/367556/2 "2016-08-19T18:21:23Z")

</div>

Hi BENEROT,

Thank you for the report. I attempted to reproduce this but I couldn’t get your results. On reopening the editor, the node doesn’t produce a compile error for me.

Could you try reproducing this in a new project and then uploading it here?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ce8ce53d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ce8ce53d](https://forums.unrealengine.com/u/anonymous_user_ce8ce53d)\
**Post date:** [August 20, 2016, 11:40pm UTC](https://forums.unrealengine.com/t/bug-find-component-in-array-from-hit-result/367556/3 "2016-08-20T23:40:28Z")

</div>

Yup, happens just the same on a new project.

Steps to reproduce:

On construction script; on a for loop; Add static mesh component and add the return values to an array.

 ![103772-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/1/8/6186c16b8acb96a234e9960c2c71b78c0e6ae7ae.png)

Then, on Event Graph: Add to find element in that same array using a get hit result. It will compile and work.

 ![103773-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/0/bd0d66b79528f17b9a676878eeddfb3a89763d19.png)

Finally, close and Open Unreal, and the event will now have an “ERROR!” and won’t be able to compile.

 ![103774-3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/7/b/67b0642cb4ada16bab674697b81f91aaee9445b6.png)

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [August 30, 2016, 7:55pm UTC](https://forums.unrealengine.com/t/bug-find-component-in-array-from-hit-result/367556/4 "2016-08-30T19:55:26Z")

</div>

Hi BENEROT,

Sorry for the delay. I was able to reproduce this and I’ve created [JIRA UE-35332](https://issues.unrealengine.com/issue/UE-35332). Our developer will be investigating the issue further. You can follow that link to check the status of the report.

Cheers,

TJ

---

<div class="post-metadata">

**Author:** ![TKZoo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TKZoo](https://forums.unrealengine.com/u/TKZoo)\
**Post date:** [November 21, 2016, 8:05pm UTC](https://forums.unrealengine.com/t/bug-find-component-in-array-from-hit-result/367556/5 "2016-11-21T20:05:34Z")

</div>

Same here, hope you fix it soon.
