How do I acess a volume's Weight value from a script?
I have a bunch of global volumes in a scene that contain a different postprocessing profile each. I would like to smoothly transition between them by modifying their Weight values by script(using an animation curve for timing). I tried declaring them by using "public Volume volume" because that's where the Weight value is, but when i try to assign the volume from the scene to the script, it doesn't accept it. I don't actually care about the postprocessing preset, as the only value I wish to change is the volume's weight. What would be the best way to do this? or am i doing something wrong?
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using UnityEngine;
public class LightingPresets : ScriptableObject
{
public Volume volume;
public AnimationCurve volumeWeight;
}
Your answer
Follow this Question
Related Questions
Script to random set active a child object? 0 Answers
pick up object using a key and then playing a sound 0 Answers
Joystick Movement Not Smooth Enough 0 Answers
Unity HUD Tracking and Target Selection 0 Answers