Changing Teams

If you want to change a players team you must make the change team call from the server. If a client trys to change their own team, it will not work. To change a team you must call the Team components ChangeTeam function. Here is an example:

GameObject myTargetObject; (set previously)
myTargetObject.GetComponent<Team>().ChangeTeam("my-new-team-name");

Remember, the above set of code must be executed by the server. No individual client can change their own team.