Hello! I’m making a multiplayer space game. I need teams for my game to be engaging or fun, but I’m not 100% sure how to do it. I have an overall concept on how it will work, but I’m not sure how if this will work or if there is a more efficient way of doing this.
My plan:
- When a player connects, a function is called on a ‘game controller’ script which asks “This player needs a team!”, and sends his gameobject’s address in the hierarchy to the script.
- The game controller checks the red team value and compares it against the blue team value. If one team has a lower amount of players than another team, put the player on the team with the lower count of players (This will sort of balance it.) If they are equal, choose red.
- Once the game controller selected a team for the player, the game controller locates the player’s gameobject and sets the “ship controller” script’s team value to either RED or BLUE. The script will resolve any friendly fire, and it should work.
Please tell me if this is a rock solid plan, if there are any flaws, or if there are places for this to be improved. Thanks for your time!