Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Switch between 2 cameras

Discussion in 'Scripting' started by cybervalie, Dec 4, 2009.

  1. cybervalie

    cybervalie

    Joined:
    Sep 27, 2009
    Posts:
    94
    Hello :)
    I want to put some cut scenes in my game. I have all what i need to do that (the cut scenes are ready to be used) except the command to switch beetween the main camera to the second camera, and back to the first camera. I only need some easy command for switch like "switchCam". I searched on google some solutions, but no one works. The script in 3d platform games is too complicate...

    Can anybody help me with a simple script command just for switch beetween my cameras?
     
  2. GargerathSunman

    GargerathSunman

    Joined:
    May 1, 2008
    Posts:
    1,571
    currentCamera.transform.tag = "Respawn";
    otherCamera.transform.tag = "MainCamera";

    The above should do it.
     
  3. bradjensen68

    bradjensen68

    Joined:
    Feb 2, 2009
    Posts:
    274
  4. cybervalie

    cybervalie

    Joined:
    Sep 27, 2009
    Posts:
    94
    Thank you very much!!! Works perfectly!! :D
    I have another question ^^... is it possible to swith from a camera to another with a fade effect?
     
  5. ivkoni

    ivkoni

    Joined:
    Jan 26, 2009
    Posts:
    978
  6. cybervalie

    cybervalie

    Joined:
    Sep 27, 2009
    Posts:
    94
    Thank you very much to both of you, helped a lot!! :D