Search Unity

Run OnParticleCollision every sec

Discussion in 'Physics' started by v_chs, Jul 10, 2020.

  1. v_chs

    v_chs

    Joined:
    Dec 11, 2019
    Posts:
    64
    I run a method in OnParticleCollision which reduces the volume of a factor. I want to remove this factor every second. Although, in OnParticleCollison the collisions are numerous and runs multiple times and very fast. Is there a way of catching it and run this reduction every second?

    Code (CSharp):
    1.    void OnParticleCollision(GameObject other)
    2.    {
    3.         factor -= reduction
    4.  
    5.    }
    6.  
     
    Last edited: Jul 10, 2020