title: Unity Camera Change C#
body: <p>I have three characters and each of them has a camera attached to them.By default they are disabled but one.I made a character selector which is supposed to change them.I have a problem where I can move the selected one but the camera stays at the last one.
  Here is the script:</p>
  
  <pre><code>    using UnityEngine;
      using System.Collections;
      using System.Collections.Generic;
      using UnityStandardAssets.Utility;
  
  
      public class GameManageer : MonoBehaviour {
  
  
  
          public Camera[] cams = new Camera[3];
          public Character CurrentCharacter;
          public List&lt;Character&gt; Characters = new List&lt;Character&gt;();
          public List&lt;Item&gt; AllItems;
          bool ShowCharWheel;
          public int SelectedCharacter;
          public int lastCharacter;
          public static GameManageer Instance;
  
  
  
          void Awake(){
              Instance = this;
  
              foreach (Character c in Characters){
                  c.Instance = Instantiate(c.PlayerPrefab, c.HomeSpawn.position, c.HomeSpawn.rotation) as GameObject;
                  c.Instance.GetComponent&lt;PlayerController&gt;().LocalCharacter = c;
              }
              ChangeCharacter(Characters[PlayerPrefs.GetInt("SelectedChar")]);
          }
  
  
          // Use this for initialization
          void Start () {
  
  
          }
  
          // Update is called once per frame
          void Update () {
  
  
              if (Input.GetKey (KeyCode.C)) {
                  ShowCharWheel = true;
              } else {
                  ShowCharWheel = false;
              }
  
  
  
          }
  
  
          void ChangeCharacter(Character c){
  
              lastCharacter = SelectedCharacter;
              SelectedCharacter = Characters.IndexOf (c);
  
              cams [SelectedCharacter].gameObject.SetActive (true);
              cams [lastCharacter].gameObject.SetActive (false);
              CurrentCharacter = c;
              Characters [lastCharacter].Instance.GetComponent&lt;PlayerController&gt; ().CanPlay = false;
              Characters [SelectedCharacter].Instance.GetComponent&lt;PlayerController&gt; ().CanPlay = true;              
              PlayerPrefs.SetInt ("SelectedChar", SelectedCharacter);
          }
  
  
  
          void OnGUI(){
              if (ShowCharWheel) {
  
  
                  GUILayout.BeginArea(new Rect(Screen.width - 64, Screen.height - 192,64,192));
                  foreach (Character c in Characters){
                      if (GUILayout.Button(c.Icon,GUILayout.Width(64),GUILayout.Height(64))){
  
                          ChangeCharacter(c);
                      }
  
                  }
                  GUILayout.EndArea();
              }
  
          }
      }
  
      [System.Serializable]
      public class Character {
  
          public string Name;
          public Texture2D Icon;
          public GameObject PlayerPrefab;
          public GameObject Instance;
          public Transform HomeSpawn;
      }
      [System.Serializable]
      public class Item{
          public string Name;
          public Texture2D Icon;
          public ItemInstance InstancePrefab;
      }
  </code></pre>