Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

FadeIn/FadeOut using Cinemachine !?

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

  1. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    704
    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:
    1,831
    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:
    704
    Thank You !
    That works perfect !
     
    Gregoryl likes this.
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,831
    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.
     
    a01169073 and el_boogie like this.
  5. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    704
    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:
    35
    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:
    1,831
    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.