Sub Cutscenes and Camera Fade

Slate Forums General Discussion Sub Cutscenes and Camera Fade

This topic contains 2 replies, has 2 voices, and was last updated by  mografi_ben 3 days, 13 hours ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1777

    mografi_ben
    Participant

    Hi Gavalakis,

    I’ve run into a small issue that I’m hoping you can help me fix.

    I have a cutscene with a nested sub-cutscene that is shorter in length. I use a ScreenFader action to fade the screen to black during the parent cutscene. But when the end of the sub-cutscene is reached, the DirectorGUI attached to the Director Camera is disabled, so the screen fader gets turned off.

    I’m using Slate 1.72. I know that’s old and I’m sure you’ve fixed this in a more recent version of Slate, but I have to stick with my older version for this game.

    Could you just point in the right direction? Happy to make the fix myself I you tell me where to look,

    Thanks!

    Ben

    #1780

    Gavalakis
    Keymaster

    Hello,

    That is actually a non-wanted behaviour. Thanks for pointing this out. I will need to find a way around this, but the code in question, can be found in Cutscene.OnSampleEnded (and OnSampleStarted) method. OnSampleEnded, is called when a cutscene’s first or last frame is called (from within Sample method). Sample on the other hand is called the same both in editor and in runtime.

    Probably a quick fix would be to only call OnSampleEnded and OnSampleStarted if the cutscene is actively playing (isActive). This way, a subcutscene (which is not actually active) will not trigger this. The change would be to locate the OnSampleStarted and OnSampleEnded calls within the Ctuscene.Sample method and do this:

    
    //...
                    if (!Application.isPlaying || isActive){
                        OnSampleStarted();
                    }
    
    //...
    
                    if (!Application.isPlaying || isActive){
                        OnSampleEnded();
                    }
    //...
    

    Let me know if this change works for you.
    Thank you.

    #1783

    mografi_ben
    Participant

    Ah, thanks!

    Perhaps it’d be better to edit the OnSampleEnded method itself and only disable the DirectorGUI if isActive? I presume we still want to RestoreLayersActive and all the other stuff in that method?

    void OnSampleEnded(){
    			RestoreLayersActive();
    			if(isActive) DirectorGUI.current.enabled = false;
    			//etc...
    		}

    What do you think?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.