Search Issue Tracker
Fixed
Votes
0
Found in
2021.2.14f1
2021.3
2022.1
2022.2
Issue ID
1419427
Regression
No
[HDRP] Visual Environment Background clouds setting doesn't change when changing via script
How to reproduce:
1. Open the user's attached "BrokenCloudTypeOverride" project
2. Enter the Play Mode in the "OutdoorsScene" Scene
3. Press the "2" key button on the keyboard to change the Visual Environment Background clouds to "Cloud Layer"
Expected result: Background clouds type changes to "Cloud Layer" and clouds become visible in the Scene
Actual result: Background cloud type changes, but visually nothing does
Reproducible with: 12.1.6 (2021.3.1f1), 13.1.8 (2022.1.0f1), 14.0.2 (2022.2.0a11)
Couldn't test with: 7.7.1 (2019.4.38f1), 10.8.1 (2020.3.33f1) (the project isn't compatible)
Note: When the Background clouds type is changed in the Inspector, the problem doesn't occur. However, if the type was changed via script, then the issue will reproduce even changing via Inspector afterward
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- PlayerPrefs get corrupted when a minimized fullscreen Player is closed through the Taskbar
- "To Debug, run app with -diag-job-temp-memory-leak-validation cmd line argument. This will output the callstacks of the leaked allocations." warning is printed when JobTempMemoryLeakValidation switch is enabled
- Main Thread stalling when loading Audio Source asset asynchronously while preloading another Audio Source asset
- Material artifacts occur in the Material Preview window when baked lighting is applied to scenes
- “ArgumentOutOfRangeException” after saving, reseting and re-add Default Tile Palette Tools to the list in Preferences window
Resolution Note:
The volume system in script doesn't work that way. You have to edit the parameter instead of creating a new instance.
Try changing the code in ChangeCloudType.cs to:
if (Input.GetKey(KeyCode.Alpha1))
{
visualEnv.cloudType.value = 0;
}
if (Input.GetKey(KeyCode.Alpha2))
{
visualEnv.cloudType.value = (int)CloudType.CloudLayer;
}
You can find documentation on how to edit volumes at runtime here https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@13.1/manual/Volumes-API.html