Q:

run a code only once when two of the same gameobjects collide

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

New to Communities?

Join the community