Search Unity

Control blend between cameras with float value at runtime?

Discussion in 'Cinemachine' started by JackBurfyMag, May 7, 2018.

  1. JackBurfyMag

    JackBurfyMag

    Joined:
    Jan 8, 2018
    Posts:
    2
    I'm loving the flexibility of Cinemachine and how easy it is to set up different cameras.
    However, I'd like to be able to control the blend between two cameras at runtime using a float value in a script.

    By which I mean, rather than the transition between two virtual cameras being an automatic animation over some amount of time, the transition being controlled by a value between 0 and 1 for example. Meaning that I could set the value to 0.5 and the scene's camera would stay at a mix between the two virtual camera's values/positions.

    Is this possible already?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Yes. Use CinemachineMixingCamera.
     
    kirbyderby2000 likes this.
  3. JackBurfyMag

    JackBurfyMag

    Joined:
    Jan 8, 2018
    Posts:
    2
    Perfect! Thanks for your help.
     
  4. nishugu2

    nishugu2

    Joined:
    Nov 24, 2017
    Posts:
    5
    i want simply transition between two cameras at run time i am using cinemachine i have turn based game of two player in which camera will see the first player at thier turn and after the first player turn the camera autmatically tranisition over the other player
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Just enable the incoming vcam and disable the outgoing vcam, using GameObject.SetActive(). Blend will be automatic, according to the blend setting in CinemachineBrain.
     
    Last edited: May 28, 2018
  6. nishugu2

    nishugu2

    Joined:
    Nov 24, 2017
    Posts:
    5
    thanks for the reply but i already did this there is no transition when 2nd camera is active
     
  7. nishugu2

    nishugu2

    Joined:
    Nov 24, 2017
    Posts:
    5
    will you plz tell me how can i develop the bubble like effect on camera by the help of cinemachine.Camera is placed on the target and moving little bit like a bubble....
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Please show me your inspectors for:
    • CinemachineBrain
    • vcam 1
    • vcam 2
    and also a picture of your project hierarchy showing those things. Then maybe I can help diagnose this.
     
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    I don't really understand this question. Can you describe a little more, or show me a reference example?
     
  10. nishugu2

    nishugu2

    Joined:
    Nov 24, 2017
    Posts:
    5
    1 i am asking about the wooble effect on camera with the help of cinemachine?
    2 another thing i want to ask can we do this(varanoi split screen) with the help of cinemahine?

     
    Last edited: May 31, 2018
  11. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    There is nothing built into Cinemachine to specifically help (or hinder) this. You can control the content of each camera with Cinemachine, but its shape on the screen is up to you.
     
  12. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    111
    I was wonder too. i want this effect so much! so in this case for now we need create a third camera to keep all 2 others and create the blend ourselves or something like that?