# Role Queue

Setting up Role Queue is Simple. Once you have edited your Lobby Configuration with your preferred roles, adding your players to select their role is simple.

{% hint style="info" %}
You should still be keeping track of your player's roles internally so that you can figure out what you will be doing!
{% endhint %}

Simply have the key as string `role`

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2FgHBJQtTi9OrLavC5vdtJ%2Fimage.png?alt=media&#x26;token=57c9e650-4f7f-4143-9a29-472fc99c84f4" alt=""><figcaption></figcaption></figure>

Once you have that, just input what role your player is queueing as and then you're set.

### Multi-Roles

In some games (like League of Legends, Overwatch) you can select multiple roles to find a game faster. This must be formatted as an array when being input to the system for it to take effect.&#x20;

The system will take in players who have the least amount of roles as the highest priority to be matched AND the order matters. If a Player doesn't mind playing anything and has all selected roles they will be in the lowest priority and their roles will be read from left to right in an array.&#x20;

Examples from the [Playflow Docs](https://docs.playflowcloud.com/unity/matchmaking#advanced-features):

```
// Player's preference array:
["support", "adc", "mid"]

// System tries:
// 1st: Can they be support? → If yes, assigned!
// 2nd: If not, can they be adc? → If yes, assigned!
// 3rd: If not, can they be mid? → If yes, assigned!
```

```
// Assignment priority (highest to lowest):
Player A: ["tank"]                    // 1 option - HIGHEST PRIORITY
Player B: ["tank", "healer"]          // 2 options - medium priority
Player C: ["tank", "healer", "dps"]   // 3 options - lowest priority

// Player A gets first choice, then B, then C
```

```
// Both want the same roles:
Player1: ["support", "adc"]  // Joined lobby first
Player2: ["support", "adc"]  // Joined lobby second

// Result:
Player1 → Gets "support" (first preference)
Player2 → Gets "adc" (support taken, gets second choice)
```

```
// Team needs: 1 top, 1 jungle, 1 mid, 1 adc, 1 support

// Players with their preferences:
Player1: ["mid", "top", "support"]     // Flexible
Player2: ["jungle"]                    // One-trick (gets priority!)
Player3: ["support", "adc"]            // Support main
Player4: ["mid"]                       // Mid only
Player5: ["top", "mid", "jungle"]      // Fill player

// Assignment result:
Player2 → jungle (most specific, only wants jungle)
Player4 → mid (most specific for mid)
Player3 → support (first preference available)
Player5 → top (mid/jungle taken, gets top)
Player1 → adc (forced to fill, but match succeeds!)
```

{% hint style="danger" %}
Also from the [Playflow Docs](https://docs.playflowcloud.com/unity/matchmaking#setting-role-preferences-in-code): "**Edge Case**: If too many players are inflexible (single role only) and want the same role, the match will fail. Always encourage some flexibility in your player base!"
{% endhint %}

### Multi Role in Unreal

In this, we are adding that we want to be Jungle and Toplane. once we have added these to our Role Selection Array, we do a join string array and then format it with open and closing brackets and set that in our Roles String Variable. Then we set that as our "role".

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2FkJJ01WXyvjeTaM6t79tH%2Fimage.png?alt=media&#x26;token=b9dbee99-a3db-440d-beb9-bb1510db1503" alt=""><figcaption></figcaption></figure>
