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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How do I check if VFX is playing?

Discussion in 'Visual Effect Graph' started by jjejj87, Mar 2, 2022.

  1. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,109
  2. KineticBen

    KineticBen

    Joined:
    Jul 19, 2021
    Posts:
    10
  3. Arficord

    Arficord

    Joined:
    Mar 31, 2019
    Posts:
    5
    check vfx.HasAnySystemAwake I think it should works fine
     
  4. FaithlessOne

    FaithlessOne

    Joined:
    Jun 19, 2017
    Posts:
    266
    Beware of using VisualEffect.HasAnySystemAwake() when the VFX Graph has a spawn delay for all their particle spawn systems. Then the method returns false. And continiously calling Play() restarts the effect so this state is maintained.

    I solved this with integrating a minimalistic fake system in the VFX Graph with spawning only one particle to enable returning true by HasAnySystemAwake until other particles are spawned:
    upload_2023-10-11_20-18-51.png