Search Unity

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,117
  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:
    315
    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