I want to change all properties of the lens distortion in my post process profile but can't. I can change the intensity and scale but not the center and multiplier values. This is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
public class Mastergame : MonoBehaviour
{
public PostProcessVolume volume;
LensDistortion lensdistortion;
void Start()
{
lensdistortion = ScriptableObject.CreateInstance<LensDistortion>();
lensdistortion.enabled.Override(true);
lensdistortion.intensity.Override(1f);
volume = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, lensdistortion);
}
void Update()
{
lensdistortion.intensity.value = Mathf.Sin(Time.realtimeSinceStartup) * 90f;
lensdistortion.center.value = new Vector2(5f, 5f);
lensdistortion.xMultiplier.value = 5f;
}
}
I have also tried the UnityEngine.Rendering.Universal library quickly but it didn't work either.
These are my errors:
Assets\Mastergame.cs(23,24): error CS1061: 'LensDistortion' does not contain a definition for 'center' and no accessible extension method 'center' accepting a first argument of type 'LensDistortion' could be found (are you missing a using directive or an assembly reference?)
and Assets\Mastergame.cs(24,24): error CS1061: 'LensDistortion' does not contain a definition for 'xMultiplier' and no accessible extension method 'xMultiplier' accepting a first argument of type 'LensDistortion' could be found (are you missing a using directive or an assembly reference?)