Search Unity

Transition between two orbit camera

Discussion in 'Cinemachine' started by Labelpastek, Jul 14, 2019.

  1. Labelpastek

    Labelpastek

    Joined:
    Nov 18, 2017
    Posts:
    4
    Hi everyone,

    Maybe this question has already asked but I don't find infos about it.
    I have two orbit camera, one main camera and one shoulder cam and I change the priority when I want to change the camera. But when a camera is not active (stand by), it doesn't turn with the active camera. So sometimes, I have a strange transition between cameras that turn around the player to go back to its last stand by position.

    Capture.PNG
    One example of cameras opposite position.

    So, is there a solution to solve that problem in Cinemachine ? Or I have to create a script to force the stand by camera to follow the X / Y axis of the active camera ?

    Thanks !
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Did you try setting the InheritPosition checkbox on the vcams?

    upload_2019-7-15_8-20-3.png
     
  3. Labelpastek

    Labelpastek

    Joined:
    Nov 18, 2017
    Posts:
    4
    Thanks Gregoryl, it works !

    Just another question : I created a script where I call two public virtual cameras. I have to use virtualCameraBase to call all kinds of camera. But I need to access to the orbit camera properties, not only virtualcamerabase properties. Is there a way to access to the proprieties of orbit camera in script ?

    Capture.PNG
     
    Gregoryl likes this.
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    For ordinary vcams, you can do this:
    Code (CSharp):
    1. var orbital = vcam.GetCinemachineComponent<CinemachineOrbitalTransposer>();
    2. orbital.m_bla = bla
    For FreeLook, you have to do it for each rig (which is a vcam):
    Code (CSharp):
    1. for (int i = 0; i < 3; ++i)
    2.     var vcam = freeLook.GetRig(i);
     
  5. Labelpastek

    Labelpastek

    Joined:
    Nov 18, 2017
    Posts:
    4
    Okay thanks !