Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

SetFloat not working correctly?

Discussion in 'Visual Effect Graph' started by JamhammerDev, Jun 4, 2020.

  1. JamhammerDev

    JamhammerDev

    Joined:
    Jul 11, 2015
    Posts:
    28
    Hi there, beginner here to vfx graph. I'm trying to set an exposed parameter via script , but nothing seems to happen in game. I have a print statement that lets me know the value of the float I just set, but I don't see it referenced in game at all. Any ideas? My code is below.

    The Graph
    upload_2020-6-4_1-58-15.png

    The Code

    VisualEffect vfx = whipPS.GetComponentInChildren<VisualEffect>();
    vfx.SetFloat("lifeTime", 1);
    MonoBehaviour.print(vfx.GetFloat("lifeTime"));


    Inspector(nested in a prefab that gets instantiated on the parent gameobject when the mode starts)
    upload_2020-6-4_2-1-43.png
     
unityunity