Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atmosphere disappears when I change the scene #41

Open
Kitseru opened this issue Mar 27, 2022 · 3 comments
Open

Atmosphere disappears when I change the scene #41

Kitseru opened this issue Mar 27, 2022 · 3 comments

Comments

@Kitseru
Copy link

Kitseru commented Mar 27, 2022

When I change the scene or reload the current one (using SceneManager.LoadScene) it seems that the PlanetEffect postprocessing effect no longer works (all the image is black except unlit shaders), and I get the error :

MissingReferenceException: The object of type 'CelestialBodyGenerator' has been destroyed but you are still trying to access it.

and the warning :

OnRenderImage() possibly didn't write anything to the destination texture!

Does anyone know where this is coming from?

@Panicat
Copy link

Panicat commented Aug 1, 2022

Same now. It used to work fine for me.

Nevermind. Cannot replicate again. It fixed itself.

@Panicat
Copy link

Panicat commented Jan 14, 2023

Had it again! Fixed by going to every line where "generator" is null, and adding a null check before that.

For example, adding the following at the start of UpdateSettings():

if (generator == null) return;

(realised this only fixes the error and makes things visible, atmospheres don't show with this method)

@Panicat
Copy link

Panicat commented Jan 20, 2023

Or try these two things two things that work for me:

  1. Clear() the list effectHolders in PlanetEffects and call Init() (in PlanetEffects.cs as well)
  2. Make the settingsUpToDate bool in AtmosphereSettings.cs public and turn it off after changing the scene

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants