Randomize array role for each player

Hello everyone, I am trying to make mini game with roles for example every game have 2 civ 1 doctor 1 police but i want to randomize the enum for 2 player have role(police , doctor) except 2 players have civ role but i don’t know how to do that i trying a lot but i got different result if anyone can help me I really appreciate it

I got players array like this

You can use my example below, mine is assigning a profile pic to a player and am storing them in their player state.

Player State BP
You can replace my player icon texture variable with your Enum Role.
If you need that role to be persistent across switching map you will need to set it to their game instance as well.

Game Mode BP
For the array, depending on your game style if a role can be assigned to only 1 player, you will want to make a remove element from array or something similar to prevent assigning duplicate role.

I don’t know why i can’t cast