Creating multiplayer teams with different roles

Hello, I was wondering about how am I able to differentiate the roles of the teams in a multiplayer level. Like for example in Deathrun in GMOD, where one player basically controls the map while the other players just walk around, but unlike Deathrun, what if I want to make that player just a camera with a different hud and functions that allow him to control everything while spectating the other players?

Would definitely try that as soon as I can! But is there any other way in which I can assign a different player controller for each player? Cause it would be better if I can create a completely different interface for each one. And another example next to Deathrun, there’s The Hunger Games. You have the players team and the game makers team. Although I guess that switching between pawns might actually do the trick. Gotta try it once I get the chance, thanks!

first, set up a game mode that allows the player to respawn:

then, in the respawn code, inside the game mode, you can get the PlayerArray from your custom GameState, get the length of that array, then get a random integer between 0 and the array length. then foreach element in the playerarray, you can branch if the array index is equal to that random number, and if it is equal, spawn a different pawn to posses.

this special pawn can have different controls and spawn a different widget for its hud.

the problem with this method, is that you might have players joining or leaving the game, and you may only want to choose the random player at the beginning of the match, so maybe instead of checking the index of the PlayerArray, you should have a boolean variable in the player controller to keep track of which player is the chosen one.

i don’t recommend it. i suggest using the same generic player controller for everyone, and moving the player interface logic into the pawn or some other actor. possesing a new pawn is easy, but player controllers are not designed to be swapped during gameplay.