Forum rules - please read before posting.

Hold Camera Fade

I am currently working on a Title Screen & Main Menu. I have the scene start, then wait a few seconds, then open the Main Menu. I want to, though, partly fade the camera before the menu opens.
Currently, the camera fades out, but then instantly fades back in again when the Main Menu opens. Is there a way to have the camera remain in it's partly faded state?

Comments

  • edited November 2021

    I'm not quite clear on the issue. Is this a case of the transition being interrupted by the menu being turned on? Or do you want to pause the transition?

    As this sounds like a visual problem, I'd appreciate a gif/video if that's possible.

    Does the Main Menu pause the game when opened? If so, you should be able to prevent this by altering the Camera: Fade Action's Behaviour when paused option.

  • Ah yes, setting the Behaviour when paused to Hold actually has the desired effect, however the menu itself now also seems to be affected by the fade, so it's a bit too dark.

  • The camera fade is drawn atop all else - including menus.

    If you want to intermix the fade and other screen elements, you'll have to manually render the fade with a custom script.

    In the MainCamera Inspector, you can uncheck Draw fade? to prevent the default fade from being drawn. The fade calculation still occurs, though, and can be accessed from the MainCamera's GetFadeAlpha function.

    This can be used to affect e.g. a Canvas Group component attached to a full-screen Image UI, which can then be ordered in between UI-based menus:

    using UnityEngine;
    
    public class CustomFade : MonoBehaviour
    {
    
        public CanvasGroup canvasGroup;
    
        private void Update ()
        {
            canvasGroup.alpha = AC.KickStarter.mainCamera.GetFadeAlpha ();
        }
    
    }
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.