Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Is it possible to access this value? (VFX graph)

Discussion in 'Scripting' started by hamik166, Oct 18, 2020.

  1. hamik166

    hamik166

    Joined:
    Oct 19, 2019
    Posts:
    31
    Hey, I have an int in my vfx, can I change the int with code during runtime?

    the int:

    https://i.imgur.com/Vowpkmp.png

    how?

    and if not, is there any kind of value that I can change?
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,697
    First you have to click that "Exposed" checkbox, and then you can change it from script like this:
    Code (CSharp):
    1. myVisualEffect.SetFloat("number", someValue);
     
  3. hamik166

    hamik166

    Joined:
    Oct 19, 2019
    Posts:
    31
    ohhhhhhhhhhhhhhhh I missed this freaking exposed, thanks, I'm stupid.