# Compare Arrays for Similar Item

**URL:** <https://forums.unrealengine.com/t/compare-arrays-for-similar-item/83281>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [January 20, 2017, 7:17pm UTC](https://forums.unrealengine.com/t/compare-arrays-for-similar-item/83281 "2017-01-20T19:17:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DMHokie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DMHokie](https://forums.unrealengine.com/u/DMHokie)\
**Post date:** [January 20, 2017, 7:17pm UTC](https://forums.unrealengine.com/t/compare-arrays-for-similar-item/83281/1 "2017-01-20T19:17:23Z")

</div>

How can I compare 2 arrays to find common items. Say I have and object that is in 2 different arrays and I want to be able to do something with any of the objects that exist in array X and array Y, and ignore any elements that don’t exist in both?

---

<div class="post-metadata">

**Author:** ![KrautPotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KrautPotato](https://forums.unrealengine.com/u/KrautPotato)\
**Post date:** [January 20, 2017, 7:21pm UTC](https://forums.unrealengine.com/t/compare-arrays-for-similar-item/83281/2 "2017-01-20T19:21:43Z")

</div>

Make a For Each Loop (Array 1)  
In the loop:  
Make For Each Loop (Array 2) -\> Output Element Array 1 = Output Element Array 2 -\> return Found

But this will probably kill the performance if the arrays are big, and if the Item at the end of an array is.

Arrays probably support a “find” (in array) function - you could try this too - if existing.

---

<div class="post-metadata">

**Author:** ![DMHokie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DMHokie](https://forums.unrealengine.com/u/DMHokie)\
**Post date:** [January 20, 2017, 7:59pm UTC](https://forums.unrealengine.com/t/compare-arrays-for-similar-item/83281/3 "2017-01-20T19:59:36Z")

</div>

Is this what you mean? How do I use the elements that exist in both?

 ![Screen Capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/b/db366dc304596de0fd76bf905a223399f38c7175.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5882066e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5882066e](https://forums.unrealengine.com/u/anonymous_user_5882066e)\
**Post date:** [January 20, 2017, 8:09pm UTC](https://forums.unrealengine.com/t/compare-arrays-for-similar-item/83281/4 "2017-01-20T20:09:14Z")

</div>

You add them to a third array.

---

<div class="post-metadata">

**Author:** ![KrautPotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KrautPotato](https://forums.unrealengine.com/u/KrautPotato)\
**Post date:** [January 20, 2017, 8:13pm UTC](https://forums.unrealengine.com/t/compare-arrays-for-similar-item/83281/5 "2017-01-20T20:13:52Z")

</div>

Yes

 ![sol1.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/b/bb9929a2cbb18f073fc3e1cc93c2f6585e4bcb8a.png)

Or:

 ![sol2.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/a/1abdb671657ea2d3f7fd3b353685eb6481ee0f7a.png)

---

<div class="post-metadata">

**Author:** ![FishMan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FishMan](https://forums.unrealengine.com/u/FishMan)\
**Post date:** [January 12, 2026, 2:08am UTC](https://forums.unrealengine.com/t/compare-arrays-for-similar-item/83281/6 "2026-01-12T02:08:43Z")

</div>

Actually there’s a node called Identical it can compare two arrays much faster than using two blueprints loops. I suggest to use this node instaed

Link to official documentation page:

> **[Identical | Unreal Engine 5.7 Documentation | Epic Developer Community](https://dev.epicgames.com/documentation/en-us/unreal-engine/BlueprintAPI/Utilities/Array/Identical)**
>
> Identical
