Forum rules - please read before posting.

[HowTo] Displaying Subtitles over a faded out camera

Hi there!

I was wondering if I was missing a feature, or if it's set in stone that the "fade" layer is always rendered on top of subtitles.

Context: I have a speaking character begins talking and then the scene gracefully fades to black. He then speaks a few more lines and he reappears with a fade in, but on a different angle.

Is this already possible to achieve without tricks?

As a temporary solution I was thinking about not using the Camera->Fade feature at all, even if it seems a bit counter-intuitive. And, I would rather have a "Menu" which actually is a screen-stretched black rectangle (hoping there are not going to be any issues with screen scaling and aspect ratio), rendered right behind the text.

Is there another way to display subtitles on a faded out camera?

Comments

  • edited December 2019

    The fade effect is drawn last in the render queue, so it will always appear above all else, including menus.

    Using a full-screen black menu would be a workaround, but there is a wiki script that delegates the fade effect to Unity UI:

    https://adventure-creator.fandom.com/wiki/Fading_with_Unity_UI

    The steps cover how to make this change for the whole game. If you just wanted to limit to a single scene, remove the "DontDestroyOnLoad" line and only uncheck "Draw fade?" in that scene's MainCamera Inspector.

  • Thanks!

    I believe I could also have a "middle ground" solution:

    Having a Unity uGUI prefab with the Fade (so it gets displayed according to the Menu order),

    having it always enabled, and checking:

        if (KickStarter.mainCamera != null)
    
        {
    
            canvasGroup.alpha = KickStarter.mainCamera.GetFadeAlpha ();
    
            rawImage.texture = KickStarter.mainCamera.GetFadeTexture ();
    
        }
    

    to stay in sync with the default fadein/fadeout actions.

    What about an Appear "OnFade" behaviour in the list of the menu options?
    I understand that's not a common case.

  • In this case, I wouldn't see a need to link it to the menu system, since Unity UI-based menus are drawn in order of their Canvas Z values. Menu ordering based on their listing in the Menu Manager is only for AC-based Menus.

  • https://adventure-creator.fandom.com/wiki/Fading_with_Unity_UI

    So does this still work? It was working fine on Unity 2020.3.14 but I updated my project to LTS Unity 2020.3.19 and it doesn't seem to work anymore.

  • I don't see why it wouldn't.

    What's your AC version, and did you update AC at the same time?

    Check your Console for messages, and view the Inspectors of both the Raw Image and Canvas Group components at the time it should kick in. What are their values set to?

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.