Hey Folks, i am trying to access via c# the exposed parameters of the visual effects graph. But i don`t know how to access them. There is only verly little documentation for it. What i actually want to do is to control an "exposed" float via Script. I have enabled the "expose" option in the graph for an float, but can`t find the variable. The script is attached to the gameobject where the visual effect object is attached to. Thanks for any help! Any help is appreciated! Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.VFX; using UnityEditor.VFX; using UnityEditor.Experimental.Rendering.HDPipeline; using UnityEditor.VFX.UI; public class particleMainScript : MonoBehaviour { UnityEngine.Experimental.VFX.VisualEffect visualEffect; float exposedParameter; void Start() { visualEffect = this.GetComponent<UnityEngine.Experimental.VFX.VisualEffect>(); // exposedParameter = visualEffect. -> what to insert here to access the expoosed parameter? } void Update() { if (Input.GetKey("down")){ visualEffect.Stop(); } else { visualEffect.Play(); } } }
Ok, found it out. You have to write: Code (CSharp): visualEffect.SetFloat("parameter", 0); "parameter" is your name of the exposed parameter