I see a second or so of my game before the Fade(in,2) sequence kicks in

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
destrucity
Posts: 24
Joined: Mon Feb 11, 2019 6:29 pm

I see a second or so of my game before the Fade(in,2) sequence kicks in

Post by destrucity »

I have a DialogueSystemTrigger set to trigger on Start and play a sequence:
Image

When I hit play in the editor, the game runs for about a second (maybe less?) before the fade kicks in. I seem to get the same result if I uncheck "Wait 1 Frame."

Maybe this goes away in builds? Any advice?

Thanks!
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: I see a second or so of my game before the Fade(in,2) sequence kicks in

Post by Tony Li »

Hi,

Test a build. It sounds like, when you hit the play button, the game hasn't fully entered play mode yet.
destrucity
Posts: 24
Joined: Mon Feb 11, 2019 6:29 pm

Re: I see a second or so of my game before the Fade(in,2) sequence kicks in

Post by destrucity »

Hi Tony,

Thanks again for all of your help. I have a video capture that show's the issue in a build. I appreciate any advice you might be able to share:

User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: I see a second or so of my game before the Fade(in,2) sequence kicks in

Post by Tony Li »

Hi,

Try unticking 'Wait One Frame'.
destrucity
Posts: 24
Joined: Mon Feb 11, 2019 6:29 pm

Re: I see a second or so of my game before the Fade(in,2) sequence kicks in

Post by destrucity »

It looks the same (or close enough that I can't tell) with "Wait 1 Frame" unchecked :(
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: I see a second or so of my game before the Fade(in,2) sequence kicks in

Post by Tony Li »

Hi,

Please back up your project and try this patch:

DS_Frame1Patch_2021-05-11.unitypackage

When a Dialogue System Trigger is set to OnStart or OnEnable, it attempts to wait until the end of the frame to allow other components' Start methods to finish first. Several Unity versions have a bug with execution order on frame 1 (the first frame of play mode) that cause "yield WaitForEndOfFrame" to incorrectly yield an extra frame. This only occurs if Unity is on frame 1. In version 2.2.17, I implemented a workaround. If a Dialogue System Trigger attempts to start on frame 1, it will start immediately instead of trying to wait until the end of the frame.
destrucity
Posts: 24
Joined: Mon Feb 11, 2019 6:29 pm

Re: I see a second or so of my game before the Fade(in,2) sequence kicks in

Post by destrucity »

Just following up to report that this does fix it. Thanks!!
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: I see a second or so of my game before the Fade(in,2) sequence kicks in

Post by Tony Li »

Great! Thanks for letting me know.
Post Reply