Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

FadeIn/FadeOut using Cinemachine !?

Discussion in 'Cinemachine' started by Vagabond_, Apr 17, 2018.

  1. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    771
    Hi, how one could add a black or white FadeIn/FadeOut with Cinemachine ?
    Want to start a cinematic cut with a fade in from black for example.

    I think one way could be adding a world space canvas to the camera with animator and toggle the canvas and animator components in timeline. In fact i just tried it but can not figure out how to toggle the animator component attached to the camera. I only can toggle the camera game object !

    Is there any more generic way of doing FadeIns and FadeOuts ?

    Thanks !
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,389
    If you're using CM 2.1.12, you can do it with a Storyboard extension on the vcam. Under the hood it's just a canvas, so it's a quick and easy way of doing what you're doing. To fade in/out, create an animation track for the vcam and animate the StoryboardExtension's alpha.
     
  3. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    771
    Thank You !
    That works perfect !
     
    Gregoryl likes this.
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,389
    Glad to hear it.

    Come to think of it, there's an even easier way: create a dummy vcam with a Storyboard extension on it. Use a black or white image. That vcam will be your "fade out" vcam - use it whenever needed. Make sure you check the "Mute Camera" checkbox, that will ensure that the vcam's transform will be ignored during blends:

    upload_2018-4-17_10-57-23.png

    Now, in the timeline, you can create fades wherever you want by overlapping clips of this vcam with other shot clips. You don't need to create animation tracks for the alpha.
     
    Gregorik, a01169073 and el_boogie like this.
  5. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    771
    Yes, that should be a bit cleaner as i am having now animator components and a storyboard components on all 3 virtual cameras. This way i will manage a single fade camera !
     
    Gregoryl likes this.
  6. Rob-Meade

    Rob-Meade

    Joined:
    Oct 27, 2016
    Posts:
    51
    Hi Gregory,

    I wonder if you may assist me with this a little. I am fairly new to cinemachine, in fact, just looking at it today.

    The scenario I have is a 2D platformer. Entry/Exit points on the left and right of the screen. I've managed to wire up the fade out based on your instuctions above, the player collides with a boxcollider2d on the right hand side, an animation trigger is set, the camera fades to black. What I can't seem to work out is how to do the reverse, not using Cinemachine anyway.

    I can create the same triggering based on the player arriving in the scene, but I can't seem to find a way to change the alpha from 1 to 0?

    Any help would be really appreciated.
     
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,389
    If you're not using timeline, it's simply a matter of setting the "black" vcam to a higher priority, and enabling it when you want to fade to black, and disabling it when you want to fade back in. Let CM's blending handle it.
     
    SteveRogers74 likes this.
  8. LAKSHAYMAVIA

    LAKSHAYMAVIA

    Joined:
    Aug 28, 2018
    Posts:
    10
    Hey Gregory,
    Thank you for Helping, I want to make fade in and out animation when the camera changes. Right now I am just fading the alpha of an image using script when player collide with cinemachine camera change collider. I want to achieve this.



    Time :- between 2:48 sec to 2:53 sec.

    Is there any way I can do that using cinemachine using storyboard or with anything else?
    Thank you.
     
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,389
    Yes. Do as it says here: https://forum.unity.com/threads/fadein-fadeout-using-cinemachine.527164/#post-3465043

    To fade to black, enable the "black" storyboard vcam. To fade back out, disable it and enable some other vcam.

    You can to the enabling/disabling from script, or by just activating a new vcam for the new shot, and playing a short timeline just before with a CM track that has a clip with the black vcam fading in and out, masking the cut.
     
  10. LAKSHAYMAVIA

    LAKSHAYMAVIA

    Joined:
    Aug 28, 2018
    Posts:
    10

    Thank you so much. Now I think I am able to grasp what you are saying. Sorry I haven't use timeline before so I don't know It's functionality much. Thank you so much for your guidance.
     
  11. Tugatsu_e

    Tugatsu_e

    Joined:
    Oct 17, 2018
    Posts:
    1
    Hey.
    1.On assets store is only CM 2.1.10 version. So I cant add new storyboard script to my camera:( Ant others idea how i can add FadeIn/Out ?
    2. I want smooth blend transition between two camera, is possible? like in this movie
     
    Last edited: Apr 3, 2019
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    2,389
    Last edited: Apr 3, 2019