# Random character role picker!

**URL:** <https://forums.unrealengine.com/t/random-character-role-picker/474158>\
**Category:** Multiplayer & Networking\
**Tags:** object-picker, unreal-engine, Multiplayer, question\
**Created:** [November 8, 2020, 10:50am UTC](https://forums.unrealengine.com/t/random-character-role-picker/474158 "2020-11-08T10:50:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IustinJey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IustinJey](https://forums.unrealengine.com/u/IustinJey)\
**Post date:** [November 8, 2020, 10:50am UTC](https://forums.unrealengine.com/t/random-character-role-picker/474158/1 "2020-11-08T10:50:10Z")

</div>

how can I make a random character selector as among us for IMPOSTOR and CREWMATES, each player to have his own role and not be repeated to someone else

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_51d4cb37](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_51d4cb37](https://forums.unrealengine.com/u/anonymous_user_51d4cb37)\
**Post date:** [January 15, 2021, 11:00am UTC](https://forums.unrealengine.com/t/random-character-role-picker/474158/2 "2021-01-15T11:00:25Z")

</div>

I also need an answer for this! please provide solutions, I can’t seem to find the solution

---

<div class="post-metadata">

**Author:** ![CGeorges](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CGeorges](https://forums.unrealengine.com/u/CGeorges)\
**Post date:** [January 15, 2021, 11:10am UTC](https://forums.unrealengine.com/t/random-character-role-picker/474158/3 "2021-01-15T11:10:22Z")

</div>

Based on the same case as Among Us I would do it this way.

I would create a function getRole which would return IMPOSTOR or CREWMATE, inside the function I would check a boolean variable `imposterExists`, if it’s true I would return “CREWMATE” directly as it can be only 1 imposter. If you need more imposters than 1 instead of boolean make it an integer and increment it every time the role is assigned and check if the max number of imposters have been given.

If that part is not executed I would have an array with 2 elements, CREWMATE and IMPOSTOR, get a random element and return it. Don’t forget to either set `imposterExists` to true if the returned element is IMPOSTOR or increment the value if you went with multiple impostors.
