Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Delay the trigger collisions to add them in a list

Discussion in 'Physics' started by v_chs, Oct 16, 2020.

  1. v_chs

    v_chs

    Joined:
    Dec 11, 2019
    Posts:
    64
    I fill a list in OntriggerEnter like this:

    Code (CSharp):
    1.     private void OnTriggerEnter(Collider other) {
    2.  
    3.         fireList.Add(other.name);
    4.      
    5.     }
    6.  
    It seems like multiple objects collide simultaneously on the start and don't get added to the list. So, the list has only two items except for four that should be.

    Is there any way of controlling this?