[RELEASED] Enviro - Sky and Weather (Dynamic Sky and Weather System)

Thanks! I looked in depth, but the error is also doing nothing… just the enviro set and just the first time

Any cool new enhancements soon?

1 Like

I am testing the latest Unity Beta 2018.3.0b7 and Enviro was basically playing nice with previous beta versions but now I am getting this error in the compiler constantly (as its an update):

NullReferenceException
EnviroSky.UpdateCameraComponents () (at Assets/Enviro - Dynamic Enviroment/Scripts/EnviroSky.cs:1378)
EnviroSky.Update () (at Assets/Enviro - Dynamic Enviroment/Scripts/EnviroSky.cs:1488)

Is there an easy quick fix for this?

Many thanks

seems my issue…

1 Like

If you find a fix please let me know. I have added a directional light for now to keep editing. I understand though that it is a beta version and couldn’t be fully supported until Unity iron out the kinks in 2018.3

Hello! Is there a set-up video that matches the current version? I have looked at two set-up videos but neither seem to match the version I just installed (2.05).

Thanks for your report. I will investigate that issue in new beta version tomorrow.

1 Like

Sorry, no newer videos for that online right now. But I will create a new setup video for 2.1 as there are some changes in setup.

I am not sure whats going on but I have Enviro installed in another project (fresh install not upgraded as previous project) and I am not sure of the behaviour but when I set it snowing that works fine until I move the character then the snow stops, possibly dependent on speed of movement. Just thought I would mention that but I understand 2018.3 may not be supported at this stage. Just thought I would mention it. Thanks again

Hi again!
I am making options menu in my game with clouds quality settings:

        switch (SKY_cloudsQualityDropdown.value)
        {
            case 0:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Flat;
                EnviroSky.instance.profile.cloudsSettings.flatCloudsResolution = EnviroCloudSettings.FlatCloudResolution.R1024;
                break;

            case 1:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Flat;
                EnviroSky.instance.profile.cloudsSettings.flatCloudsResolution = EnviroCloudSettings.FlatCloudResolution.R2048;
                break;

            case 2:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Flat;
                EnviroSky.instance.profile.cloudsSettings.flatCloudsResolution = EnviroCloudSettings.FlatCloudResolution.R4096;
                break;
            case 3:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Volume;
                EnviroSky.instance.profile.cloudsSettings.cloudsQuality = EnviroCloudSettings.CloudQuality.Medium;
                break;

            case 4:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Volume;
                EnviroSky.instance.profile.cloudsSettings.cloudsQuality = EnviroCloudSettings.CloudQuality.High;
                break;

            case 5:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Both;
                EnviroSky.instance.profile.cloudsSettings.cloudsQuality = EnviroCloudSettings.CloudQuality.Ultra;
                EnviroSky.instance.profile.cloudsSettings.flatCloudsResolution = EnviroCloudSettings.FlatCloudResolution.R4096;
                break;
        }

Code is working very well but I want to save this settings to next scene - beacuse options menu is only in Menu scene
After hitting play, all settings have been restored to default. Any Idea how to “save” this settings ?
Regards!

Hello, I would save the sky quality setting in playerprefs. Then check if there is an entry when you start your game, read that and call your function with the saved value. When users changes the quality save again to playprefs of course.

Oh you also most likely don’t want to change the values from profile, instead change the runtime values.

Something like this:

public void SetSkyQuality(int quality)
{
switch (quality)
        {
          
            case 0:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Flat;
                EnviroSky.instance.cloudsSettings.flatCloudsResolution = EnviroCloudSettings.FlatCloudResolution.R1024;
                break;

            case 1:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Flat;
                EnviroSky.instance.cloudsSettings.flatCloudsResolution = EnviroCloudSettings.FlatCloudResolution.R2048;
                break;

            case 2:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Flat;
                EnviroSky.instance.cloudsSettings.flatCloudsResolution = EnviroCloudSettings.FlatCloudResolution.R4096;
                break;
            case 3:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Volume;
                EnviroSky.instance.cloudsSettings.cloudsQuality = EnviroCloudSettings.CloudQuality.Medium;
                break;

            case 4:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Volume;
                EnviroSky.instance.cloudsSettings.cloudsQuality = EnviroCloudSettings.CloudQuality.High;
                break;

            case 5:
                EnviroSky.instance.cloudsMode = EnviroSky.EnviroCloudsMode.Both;
                EnviroSky.instance.cloudsSettings.cloudsQuality = EnviroCloudSettings.CloudQuality.Ultra;
                EnviroSky.instance.cloudsSettings.flatCloudsResolution = EnviroCloudSettings.FlatCloudResolution.R4096;
                break;
        }

//Save
PlayerPrefs.SetInt("Sky_Quality", quality);
}

//Load your setting and apply it
public void LoadSkyQuality()
{
if (PlayerPrefs.HasKey("Sky_Quality"))
{
    int skyQuality = PlayerPrefs.GetInt("Sky_Quality");
    SetSkyQuality(skyQuality);
}
}

Do you mean something like a load settings method ?
I need to finish my options script - I have save button and it saves global variables to json but i still dont have my load method so maybe a good idea will be to call load method at start of a game. I never thought about it, i was saving options like that using prefabs. I will finish it in near future and i will try to save it this way. Thanks and Regards! :smile:

1 Like

Hi first of all I want to say this is a great asset, AAA quality and really customizable everyone testing my game noticed the sky quality.
Now I noticed an issue with weather loading so I called it with a coroutine and works great. But is there any tutorial on weather settings? I have this problem with particles not following the camera when moving.

Hello, thanks! Great to hear. :slight_smile: The weather particle will follow the player transform that you assigned. Please check if it is the correct one, or assign your camera there too.

1 Like

The problem is that when I move I get a temporary lag between camera movement and particle system it takes about 1 second before rain starts falling again, is this expected or is there a workaround like increasing particle system size?

Sounds like that you move your camera very fast. Default the particles are simulated in world space in a small circle around the player. Please first try to increase the particle system circle shape radius, also maybe make particle a bit faster. You also could set them to “Local Space” if you still outrun the particles.

1 Like

Hi Vondex, hope alls well. Did you manage to find a solution for the error mentioned above which was:.

NullReferenceException
EnviroSky.UpdateCameraComponents () (at Assets/Enviro - Dynamic Enviroment/Scripts/EnviroSky.cs:1378)
EnviroSky.Update () (at Assets/Enviro - Dynamic Enviroment/Scripts/EnviroSky.cs:1488)

Many thanks

Hello, please try latest beta version 2018.3.0.b8. It works nice for me. The error you mention is a bit strange, as this line of code should not be used in any newer version than 2017.3.0. Looks like a bug in Unity 2018.3.0b7…

Please tell if you still gettings issues in latest beta, but for me it is working now.

1 Like

Thanks Vondex, I will backup and post a response after updating.

Although I do have enviro working fine in 3.0…7 on another project so I’ll keep my fingers crossed.

Thanks again

Have you already tried to right-click and re-import the EnviroSky.cs?

1 Like