Uruchom kod tylko raz, gdy zderzyją się dwa z tych samych

OnCollisionEnter2D(Collision2D other)
{
  if(other.GetInstanceID() > GetInstanceID())
  {
    whatever you want to run
  }
}
  
Tense Thrush