# Character Array/Map Selection

**URL:** <https://forums.unrealengine.com/t/character-array-map-selection/491205>\
**Category:** Editor Scripting\
**Tags:** arrays, boolean, maps, spawn-actor-from-cla, unreal-engine, question\
**Created:** [November 23, 2021, 12:41pm UTC](https://forums.unrealengine.com/t/character-array-map-selection/491205 "2021-11-23T12:41:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WBoden](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WBoden](https://forums.unrealengine.com/u/WBoden)\
**Post date:** [November 23, 2021, 12:41pm UTC](https://forums.unrealengine.com/t/character-array-map-selection/491205/1 "2021-11-23T12:41:40Z")

</div>

Hey there,

I’m trying to set up a player character class setup in my JRPG project. I’m at the moment attempting to setup on who spawns and who doesn’t. I figured that connecting it with a Boolean check would help with keeping the variable from switching out order due to the fact the names must stay in order. Example

Correct orderly way: Unit 1(Check) - Unit 2(Un-check) - Unit 3(Check) - Unit 4(Check) - Unit 5(Check) - Unit 6(Un-check)

Incorrect orderly way: Unit 1(Check) - Unit 3(Check) - Unit 4(Check) - Unit6(Check) - Unit 2(Un-check) - Unit 5(Un-check)

I have a current setup that using “For Each Loop” to show the current player characters but I would like the ones to show up if they are selected which come in the Boolean and maybe with the Branch connected with the Spawn Actor.

 ![352852-screenshot-2021-11-22-150847.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/8/47876abc4ac7cdaded2dd8afb66ccf9c3e24bf1c.png)

][1]

Please, does anyone know a way to make your Array/Map of player characters spawn class from a Boolean check connected to the SpawnActor or so? I just want an idea of how to connect that.

---

<div class="post-metadata">

**Author:** ![NtrickN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ntrickn/32/474191_2.png) [@NtrickN](https://forums.unrealengine.com/u/NtrickN)\
**Post date:** [November 23, 2021, 7:36pm UTC](https://forums.unrealengine.com/t/character-array-map-selection/491205/2 "2021-11-23T19:36:08Z")

</div>

Assuming your array called **Party Members** is an array of **Explore Character** classes, define a **shouldSpawn?** bool or something of the sort in that class. Set it true or false as needed via editor or runtime.

When you drop into that for loop, before you spawn, you can get the instance of your Explore Character class in the array at current index, get the value of the **shouldSpawn?** , and branch accordingly.

---

<div class="post-metadata">

**Author:** ![WBoden](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WBoden](https://forums.unrealengine.com/u/WBoden)\
**Post date:** [November 24, 2021, 10:51pm UTC](https://forums.unrealengine.com/t/character-array-map-selection/491205/3 "2021-11-24T22:51:45Z")

</div>

Can somehow show me on that? The Explore Characters are indeed the array.
