Without an outside class calling Fader, the script won’t do anything. Paste in your SavingWrapper.cs script, which is the first thing that calls the Fader.
However, when I set the _canvasGroup.alpha to 0 in the FadeOutImmediate() method in my Fader.cs, the game plays as intended, except there’s no faders at all. Don’t know if that helps at all.
When my game and Fader starts it just shows the blank white screen as before with no console messages. But when I (blindly) move to a portal i get the follwoing message:
“Fader CanvasGroup = 1”
Which makes sense. So it looks like the Fader isn’t changing like it’s supposed to.
I just popped back into the course code, and I spotted a key difference…
You have
while (Mathf.Approximately(_canvasGroup.alpha, target))
but the course has
while (!Mathf.Approximately(canvasGroup.alpha, target))
I’m not concerned with the underscore, that’s a preference issue, the problem is with the !.. or lack thereof…
I’m pretty sure what’s happening is that FadeIn never gets a chance to run,because a Fade from 1 to 0 will fail the While check immediately, and never adjust the canvas (or debug!) But when you Fadeout, with that Canvas at 1, then the While loop will never end, locking you up at 1.
Slip that ! in and see what happens, you should start seeing debugs when the game loads, then debugs to fade out, and debugs to fade in when you go through the next portal.
Don’t feel too bad, that was my 5th reading of the code, and I missed it. I did have the clue that FadeIn didn’t appear to be getting called (FadeIn would have a target of 0), and you had no messages till you portalled, which of course starts with a FadeOut… That got me going back to the source code, and then finally I noticed the !
It’s just like my teacher told me in middle school (a long long long long time ago)… “Punctuation matters”