# How to Make an Array from every valid connected pin at a Select Node?

**URL:** <https://forums.unrealengine.com/t/how-to-make-an-array-from-every-valid-connected-pin-at-a-select-node/1931224>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [July 9, 2024, 3:35am UTC](https://forums.unrealengine.com/t/how-to-make-an-array-from-every-valid-connected-pin-at-a-select-node/1931224 "2024-07-09T03:35:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![XxNotAGamerxX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XxNotAGamerxX](https://forums.unrealengine.com/u/XxNotAGamerxX)\
**Post date:** [July 9, 2024, 3:35am UTC](https://forums.unrealengine.com/t/how-to-make-an-array-from-every-valid-connected-pin-at-a-select-node/1931224/1 "2024-07-09T03:35:28Z")

</div>

1. How can I populate an Array (add indexes) for each valid and unique PIN (object) that is connected to a Select node? (to make a matching pair)
2. Or what is an alt Node method (that displays Enum options / has named Enum pins) - so that names match? Ty 🙂

- Meaning I want to use a Select node (because it spells out the names) so Users know where to manually connect their SK meshes - which I want them to match to [the named Enum categories] connected to the Select node.
- 
  - I want to simplify setup by only requiring the User to connect their [unknown number of] SK meshes once - to the Select node, after which [my code] sets up other variables to match. This is why I cant use a Make array node & Loop, before the Cases node:

* * *

- 
  - I tried the code below, but it does not work to make an array of all [attached pins] because the Select Enum can only be set to 1 item/index at a time - so it stops at only 1 item.

- 
  - How can I loop this logic to cycle through every Enum element in the Enum variable (7 indexes)? \> and set each as an Array index of the SK mesh variable type?

- 
  - (The code in the gray box is a community plugin, which may or may not be a way to get the solution. But I need one Event to trigger multiple pins, so I can loop \> set each Enum for the # of indexes it has \> to then use the Select node in a loop \> to add to the Array.)

 ![BP_FirstPersonCharacter1_EnumTest_00006](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/0/02037490478d4db068eb31622dac94fd21f6793a.png)

---

<div class="post-metadata">

**Author:** ![XxNotAGamerxX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XxNotAGamerxX](https://forums.unrealengine.com/u/XxNotAGamerxX)\
**Post date:** [July 9, 2024, 7:07am UTC](https://forums.unrealengine.com/t/how-to-make-an-array-from-every-valid-connected-pin-at-a-select-node/1931224/2 "2024-07-09T07:07:40Z")

</div>

I found this incomplete code that seems to make a loop by getting length of Enum.

1. Anyone know how to complete it - what connects to the -1/1 reroute pin?  
 ![UnrealEditor_pHHzndPPhr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/7/6/f76a5e96e958a0cdc9c47230f3d15524f95a6505.png)

> [@How to properly loop through enumerations](https://forums.unrealengine.com/t/how-to-properly-loop-through-enumerations/333671/6):
>
> I’m used to do that in BP, works well slight_smile

And what did he mean by making an extra (unused index) in the enum?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 9, 2024, 7:22am UTC](https://forums.unrealengine.com/t/how-to-make-an-array-from-every-valid-connected-pin-at-a-select-node/1931224/3 "2024-07-09T07:22:40Z")

</div>

> [@XxNotAGamerxX](#):
>
> a matching pair

Are you sure you’re not simply looking for the `tMap`:

> **[Map Containers in Unreal Engine | Unreal Engine 5.4 Documentation | Epic...](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/BP_HowTo/WorkingWithMaps/)**
>
> TMaps are defined by two types, a key type and a value type, which are stored as associated pairs in the map in Unreal Engine.

It allows for association: `Enumerator` → `Skeletal Mesh`, for example. Maps and Sets only sport unique keys by default.

* * *

> How can I loop this logic to cycle through every Enum element in the Enum variable

You can literally loop through any enumerator:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/1/b61707ee07418c7a08415d3eb05708925cbb9936.png)

Search for `ForEach YourEnumerator`

* * *

Not gonna lie, not entirely sure what the end goal here is, so my suggestion might be _off_.

* * *

> what connects to the -1/1 reroute pin

Index cycling, most likely. You `++` / `--` to pull next / previous element from the enumerator - just an int here. That’d be useful if you had something like a weapon select wheel (like GTA) and wanted to cycle through available choices.

I feel like the person did not realise one can loop through enums or add bytes:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/f/0bfd3190be3769ee888f71292a5cf65e9bea2404.png)

But, perhaps, the rest of the script needed integers.

---

<div class="post-metadata">

**Author:** ![XxNotAGamerxX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XxNotAGamerxX](https://forums.unrealengine.com/u/XxNotAGamerxX)\
**Post date:** [July 9, 2024, 7:54am UTC](https://forums.unrealengine.com/t/how-to-make-an-array-from-every-valid-connected-pin-at-a-select-node/1931224/4 "2024-07-09T07:54:33Z")

</div>

Yes thanks! That Enum Loop is what I needed 🙂 . I couldnt find the correct way to get it w/specific Enum.

- And yes ty for the PSA, I use Map in my function (which was the other goal).

Does this look correct?

 ![BP_FirstPersonCharacter1_EnumTest_00008](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/8/f1847f9274b19b70744d410fe510dec2b51cee52.jpeg)  
 ![UE5 Enum loop length test](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/f/1dfaca677b96d8613cadca9bc32f353c28bf3d53.png)

* * *

Bonus:

> [@Everynone](#):
>
> Index cycling, most likely. You `++` / `--` to pull next / previous element from the enumerator - just an int here. That’d be useful if you had something like a weapon select wheel (like GTA) and wanted to cycle through available choices.

That’s my next goal lol. Can you show a pic of that ++ connection for context?

- I have this but in a different context. I’d also like the mouse scroll meth. Ty 🙂  
 ![BPGraphScreenshot_2024Y-07M-09D-00h-52m-24s-369_00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/5/b65fa3767e4fb14671129a69ac17c6e22679215e.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 9, 2024, 8:39am UTC](https://forums.unrealengine.com/t/how-to-make-an-array-from-every-valid-connected-pin-at-a-select-node/1931224/5 "2024-07-09T08:39:06Z")

</div>

Looks fine to me.

* * *

Either this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/2/2/82258cacfd15f4fe578fcd4217f10050ec7e7c2d.png)

Or something very close to this.

* * *

Something older, with integers:

[https://dev.epicgames.com/community/learning/tutorials/qZ7/weapon-cycling](https://dev.epicgames.com/community/learning/tutorials/qZ7/weapon-cycling)

---

<div class="post-metadata">

**Author:** ![XxNotAGamerxX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XxNotAGamerxX](https://forums.unrealengine.com/u/XxNotAGamerxX)\
**Post date:** [July 9, 2024, 8:20pm UTC](https://forums.unrealengine.com/t/how-to-make-an-array-from-every-valid-connected-pin-at-a-select-node/1931224/6 "2024-07-09T20:20:25Z")

</div>

> [@Everynone](#):
>
> weapon-cycling

Thanks for the pic and link.  
But the link is 404. This is why I cannot find old tutorials, Epic keeps redeemering their official links.  
Do you know where the new link is? (I searched, didn’t find.)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 9, 2024, 10:37pm UTC](https://forums.unrealengine.com/t/how-to-make-an-array-from-every-valid-connected-pin-at-a-select-node/1931224/7 "2024-07-09T22:37:27Z")

</div>

![wcycle.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/8/6b89be86e07d8fb5d263877ff565a61f2ac565a8.png)

The tut (not really one) was published when the tool was in its infancy, perhaps that’s why it’s acting up. Pic related.

---

<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:** [August 8, 2024, 10:37pm UTC](https://forums.unrealengine.com/t/how-to-make-an-array-from-every-valid-connected-pin-at-a-select-node/1931224/8 "2024-08-08T22:37:38Z")

</div>

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