Monday, February 24, 2025
spot_img

Altering submit processing with code in unity would not absolutely work


I wish to change all properties of the lens distortion in my submit course of profile however cannot. I can change the depth and scale however not the middle and multiplier values. That is my code:


utilizing System.Collections;
utilizing System.Collections.Generic;
utilizing UnityEngine;
utilizing UnityEngine.Rendering.PostProcessing;

public class Mastergame : MonoBehaviour
{
    public PostProcessVolume quantity;
    LensDistortion lensdistortion;

    void Begin()
    {
        lensdistortion = ScriptableObject.CreateInstance();
        lensdistortion.enabled.Override(true);
        lensdistortion.depth.Override(1f);
        quantity = PostProcessManager.occasion.QuickVolume(gameObject.layer, 100f, lensdistortion);

    }

    void Replace()
    {

        lensdistortion.depth.worth = Mathf.Sin(Time.realtimeSinceStartup) * 90f;
        lensdistortion.heart.worth = new Vector2(5f, 5f);
        lensdistortion.xMultiplier.worth = 5f;
    }
}

I’ve additionally tried the UnityEngine.Rendering.Common library rapidly but it surely did not work both.

These are my errors:

AssetsMastergame.cs(23,24): error CS1061: ‘LensDistortion’ doesn’t include a definition for ‘heart’ and no accessible extension technique ‘heart’ accepting a primary argument of kind ‘LensDistortion’ could possibly be discovered (are you lacking a utilizing directive or an meeting reference?)

and AssetsMastergame.cs(24,24): error CS1061: ‘LensDistortion’ doesn’t include a definition for ‘xMultiplier’ and no accessible extension technique ‘xMultiplier’ accepting a primary argument of kind ‘LensDistortion’ could possibly be discovered (are you lacking a utilizing directive or an meeting reference?)

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest Articles