You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone, I've been struggling for few days with a null ref when I want to reload or change scene.
I feel like the script keeps running when I change scenes. I tried to destroy and re instantiate or disable and enable my script for my planet and my camera but still the same error.
The error seems to come from the PlanetEffects.cs because when I remove it, the error disappears but I have no more ocean or atmosphere.
I also noticed that in runtime, when I refresh PlanetsEffect (line break and save) the error disappears and everything works again.
I'm pretty new to gamedev and I'm sure I'm missing a concept or something.
If anyone can enlighten me that would be great!
I hope I was clear in my explanation.
in advance, thank you
The text was updated successfully, but these errors were encountered:
I think you figured out most of it. PlanetEffects.cs, unlike many other scripts, is a scriptable object, which means its instance is always saved. (when in edit mode, it's also saved on the disk) Workaround? Probably would involve making pivate effectHolders list public, clearing it and calling the Init() method when done changing the scene.
Though this is my speculation and I couldn't test it, I believe that's what's going on.
Thanks for your reply :
I tried something like this in my loading system
I also made my effectHolders list public. I did the same for the Init method to be able to call them in my loading system, but still the same error. Did I do something wrong?
Hello everyone, I've been struggling for few days with a null ref when I want to reload or change scene.
I feel like the script keeps running when I change scenes. I tried to destroy and re instantiate or disable and enable my script for my planet and my camera but still the same error.
The error seems to come from the PlanetEffects.cs because when I remove it, the error disappears but I have no more ocean or atmosphere.
I also noticed that in runtime, when I refresh PlanetsEffect (line break and save) the error disappears and everything works again.
I'm pretty new to gamedev and I'm sure I'm missing a concept or something.
If anyone can enlighten me that would be great!
I hope I was clear in my explanation.
in advance, thank you
The text was updated successfully, but these errors were encountered: