void OnCollisionEnter(Collision collision) { Instantiate(soundEffect, collision.transform.position, Quaternion.identity); GravityObject collisionGravObj = collision.gameObject.GetComponent <GravityObject>(); if (collisionGravObj.GetID() < GetID()) { AddMass(collisionGravObj.GetMass()); Destroy(collision.gameObject); } }