Setting Properties from Script does not show, although Property seems to be changed.

Hey fellow VFX-Friends,

I am trying to change some Property values via a script. The code I use is here:

public void Awake()
{
    _connecterEffect = gameObject.GetComponent<VisualEffect>();
}

AND

public Vector3 IntermediateOne
{
    get { return _intermediateOne; }
    set
    {
        Debug.Log(String.Format("We grab the value: {0}", _connecterEffect.GetVector3("IntermediateOne")));
        _intermediateOne = value;
        _connecterEffect.SetVector3("IntermediateOne", value);
        Debug.Log(String.Format("After SET we get the value: {0}", _connecterEffect.GetVector3("IntermediateOne")));
    }
}

What is surprising is that in the second _connecterEffect.GetVector3(...) I indeed get the correct value. But it does not show in the inspector, nor does the VFX-Graph change its behaviour accordingly.

Help would be greatly appreciated.

Hi, just as a sanity check, is the property in question exposed?
5934065--634823--upload_2020-6-3_10-11-58.png

Hi, thanks for the response. Yes it is. Actually here is a picture of the 4 properties I am trying to alter:

These VFX-Graphs are part of a Prefab, which looks like this:

5935334--635006--Exposed.png

If I do the changes to the properties within the function the Prefab is instantiated in, I don’t have any Problems. It feels like the values for the “wrong” VFX-Graph are changed.

Interesting, would you be able to submit a bug with the assets in question (or upload them here as a package) for us to take a look at?

Hey, I will try to recover the bug.
I solved it by reinstantiating prefabs for now. Which is not that good but yeah. :slight_smile:

1 Like