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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Particle Collision on a Collider

Discussion in 'Scripting' started by Altissimus, Jun 3, 2019.

  1. Altissimus

    Altissimus

    Joined:
    May 11, 2015
    Posts:
    49
    Hi,

    I want to trigger code off the result of a particle system hitting a collider.

    If this was a game object, it would be:

    Code (CSharp):
    1. void OnTriggerEnter (Collider other)
    2. {
    3. if (other.tag == "Particle")
    4. {
    5.  
    ...and off we go. But it's not. From googling, I understand it is not possible to get a particle to trigger a collider on enter. Please correct me if I'm wrong.

    So, instead, we go...

    Code (CSharp):
    1. void OnParticleCollision(GameObject other)
    2. {
    3. if (other.tag == "Particle")
    4. {
    ...and that supposedly works.

    But, in the former example, it works when the collider is a trigger; in the latter example it works when the collider is not. However, I don't want the particle to hit the object, I want it to hit it's collider - which is (for my purposes) considerably larger than the object. Therefore I can't make that collider a non-trigger, because then everything else will hit it too. A problem.

    Can anyone point me in the direction of a solution, please?

    Thanks,
    A
     
  2. Altissimus

    Altissimus

    Joined:
    May 11, 2015
    Posts:
    49
  3. Altissimus

    Altissimus

    Joined:
    May 11, 2015
    Posts:
    49
    ...bump? Is this in the wrong forum or something?