Fader Issue

Hello,

It looks like my Fader is working “sometimes” only… I cannot catch when exactly this bug occurs and when it is not it looks like random

Usually when it happen I get those errors:


It nicely fadeOut when I go thorugh the portal but then it stays black and not fadeIn, I know that game is still runing corectly because enemies can hit me and i see that my health is decresing but fader is on so i cannot see te scene.

Any ideas what i did wrong?

thank you for your answer in advance :slight_smile:

The key is in the first “warning” message (in my opinion, this should be a full red error, but Unity seems to want to “warn” you that your project is about to completely misbehave instead of waving the much needed red flag.

One or more of your Portals are under a parent GameObject. It actually makes sense (usually) to do this… group similar scene objects together to reduce clutter, etc… but anything that is DontDestroyOnLoad cannot have a parent, it must be at the root of the heirarcy. Move the Portal out of the neatly organized GameObject and things should work great.

Hello Brian,
Thank you for your quick answer!

All my portals in both Sandboxes are in top level, but this issue still occurs.

I noticed that this issue does not occur when both views Scene and Game are opened… :open_mouth: that is super weird! When only Game windows is open, and Scene view is behind - this bug is reproduced each time.

Issue when:

No Feader Issue when:


But when Fader seems to be ok… then it look like saving system is working in every other round, I mean:

  • start in sandbox1
  • kill enemy in sandbox1
  • went through portal to sandbox2
  • comeback to sandbox1 ( enemy is still killed)
  • went through portal to sandbox2 again
  • comeback to sandbox1 again ( enemy is alived?!) :open_mouth:

in this scenario I also get some warning about NavMesh… I have no idea how to connect all this dots :thinking:

The NavMesh warning is insignificant, happens often on the first frame, and is corrected immediately after on the next frame.

Something is trying to go DontDestroyOnLoad() from under another GameObject. May be unrelated to what’s going on, then. Most often, it’s the Portals (this is actually the first time it isn’t), which is why it was my first reaction.

The next place to check is where the default weapon is being equipped. We started you out putting this in Start(), but Capture and RestoreState() occur before Start() is called. This means we need to move the equipping of the default weapon to Awake().

1 Like

Thank you so much Brian!
You are right :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms