# How to make 2 teams in multiplayer system: friendly & enemy teams?

**URL:** <https://forums.unrealengine.com/t/how-to-make-2-teams-in-multiplayer-system-friendly-enemy-teams/143251>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [May 10, 2020, 7:48pm UTC](https://forums.unrealengine.com/t/how-to-make-2-teams-in-multiplayer-system-friendly-enemy-teams/143251 "2020-05-10T19:48:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_d19a6e24](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d19a6e24](https://forums.unrealengine.com/u/anonymous_user_d19a6e24)\
**Post date:** [May 10, 2020, 7:48pm UTC](https://forums.unrealengine.com/t/how-to-make-2-teams-in-multiplayer-system-friendly-enemy-teams/143251/1 "2020-05-10T19:48:01Z")

</div>

Hi,

1. i have to set random team joining like 3v3 and players join without their choice so we don’t ask which team you like
2. when player joins a team, his team name and score should be blue and enemy stuff, red. its related to HUD but what to do for recognizing teams? i have no idea  
its my first multiplayer project. the session is done but the teams aren’t.  
so it looks simple but i need to know structure of team making in ue4  
thanks a lot 😉

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [May 10, 2020, 9:06pm UTC](https://forums.unrealengine.com/t/how-to-make-2-teams-in-multiplayer-system-friendly-enemy-teams/143251/2 "2020-05-10T21:06:20Z")

</div>

Use a struct containing two team (arrays). Team 1 (blue), Team 2 (red). On player join assign to a team by storing player id in the chosen array. Reference the struct as needed. Another option is to create a team variable in playerstate assign a team name to it.

---

<div class="post-metadata">

**Author:** ![Capn\_C4ke](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/capn_c4ke/32/1194596_2.png) [@Capn\_C4ke](https://forums.unrealengine.com/u/Capn_C4ke)\
**Post date:** [May 11, 2020, 4:39am UTC](https://forums.unrealengine.com/t/how-to-make-2-teams-in-multiplayer-system-friendly-enemy-teams/143251/3 "2020-05-11T04:39:33Z")

</div>

Don’t use a struct, use an enum, go on YouTube, and search “ue4 enum”, and you’ll get all the info you need. It’s a list of variables that you can switch based off of that players team. when that player is spawned set a variable that is replicated, and is set to your custom enum, and then do logic based off of that. ie: if enum == blue, then set player color to blue.and Also set a variable in player state, so the server can access it easier. I can send pictures if you need further help

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d19a6e24](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d19a6e24](https://forums.unrealengine.com/u/anonymous_user_d19a6e24)\
**Post date:** [May 11, 2020, 5:50pm UTC](https://forums.unrealengine.com/t/how-to-make-2-teams-in-multiplayer-system-friendly-enemy-teams/143251/4 "2020-05-11T17:50:49Z")

</div>

> [@Capn\_C4ke](#):
>
> Don’t use a struct, use an enum, go on YouTube, and search “ue4 enum”, and you’ll get all the info you need. It’s a list of variables that you can switch based off of that players team. when that player is spawned set a variable that is replicated, and is set to your custom enum, and then do logic based off of that. ie: if enum == blue, then set player color to blue.and Also set a variable in player state, so the server can access it easier. I can send pictures if you need further help

it seems that i need more explanation. i learned how enum works but dont know how to work with it on event **OnPostLogin.**  
when a player joins the game he is already spawned in map (character is selected before) so in joining time the team variable should be determined for the player.  
send pictures please

---

<div class="post-metadata">

**Author:** ![KidneyProblems](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KidneyProblems](https://forums.unrealengine.com/u/KidneyProblems)\
**Post date:** [July 28, 2021, 4:20am UTC](https://forums.unrealengine.com/t/how-to-make-2-teams-in-multiplayer-system-friendly-enemy-teams/143251/5 "2021-07-28T04:20:29Z")

</div>

I’m currently trying to use enum too for team selection, but is there a way to assign a random player controller to the enum?

---

<div class="post-metadata">

**Author:** ![Capn\_C4ke](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/capn_c4ke/32/1194596_2.png) [@Capn\_C4ke](https://forums.unrealengine.com/u/Capn_C4ke)\
**Post date:** [August 30, 2021, 10:57pm UTC](https://forums.unrealengine.com/t/how-to-make-2-teams-in-multiplayer-system-friendly-enemy-teams/143251/6 "2021-08-30T22:57:13Z")

</div>

What do you mean by assigning the player controller to the enum?

---

<div class="post-metadata">

**Author:** ![xxTESCHIO81xx1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xxTESCHIO81xx1](https://forums.unrealengine.com/u/xxTESCHIO81xx1)\
**Post date:** [March 29, 2026, 11:40pm UTC](https://forums.unrealengine.com/t/how-to-make-2-teams-in-multiplayer-system-friendly-enemy-teams/143251/8 "2026-03-29T23:40:55Z")

</div>

try this guide!!!

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/7/7/07768800cf271eec87eda36cf17465e8c0e756aa.jpeg "Unreal Engine 5.7: Automatic Team Balance System (No Widgets) | IGAME Series #3") ](https://www.youtube.com/watch?v=qzoqpe2Xbic)
