Search Unity

Swapping between 3d game and 2d game, camera.

Discussion in 'Cinemachine' started by sTorrr, May 11, 2019.

  1. sTorrr

    sTorrr

    Joined:
    Oct 28, 2018
    Posts:
    128
    Hi, im making a 3d game such as "Dont Starve" with paper like graphics, but I want to be able to swap between 3d game and 2d game. For example I want it to be 3d game when on ground fighting mobs, then when climbing uphill I want game to swap to a 2d game, such as super mario. then swap back when on top of the hill. Is this possible to achieve, and is it possible to achieve with a smoothe transition without loading screen and such?
     
  2. sTorrr

    sTorrr

    Joined:
    Oct 28, 2018
    Posts:
    128
    Note, im not using Cinemachine for my RTS camera and Im not sure how to achieve all the features I got on my RTS camera, using Cinemachine, if possible. However I do know Cinemachine is fantastic for 2d platform, and I guess it is good for making such transitions Im looking for, if possible. I freaquently read that everything is possible....
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    Cinemachine does not explicitly handle the case of blending smoothly between perspective and ortho camera.

    However, you can approximate an ortho camera with a perspective camera placed very far away, with the smallest possible FOV. You can blend to that from your normal perspective camera, and when you get there, just cut to the equivalent ortho camera. That works pretty well.
     
  4. sTorrr

    sTorrr

    Joined:
    Oct 28, 2018
    Posts:
    128
    Nice, thanks for the reply. My main concern then is how to program this. I want camera to be forced to face towards ortho as character, 3rd person, gets closer to a certain area, and simultainiously return to default if player regrets going there, r-click to moove, nav mesh. As this is 3d with paperlike graphicks I would have to transform character to tilt like a bilboard while this effect is on. I also want to be able to hover camera over the same area without fading effect, only when player gets closer I want fade. This means that the 2D level would have to be hidden and only apear when the camera enters the correct angle, tilting upwards towards the sky. I also thinks this means that camera would hve to be forced to enter a given path,curved fade towards the 2D sprites regardles of camera rotation when player gets closer to given location. This to make sure that the 2D sprites for the orthogonal level is not vissible in the 3D view or the transition to 2d view. I want to hide the Ortho levels in the 3d view and visa versa. Is all this possible without loading screen? And can I still unload the 3D scene while in 2D and visa versa for both visually, dont want 3d sprites to apear or limit my possabilities, and for better performace.

    Im not sure if I explained myself correctly