if a game object has a collider code example
Example: unity check if a gameobject has a component
if(gameObjectToCheck.GetComponent<Rigidbody>() != null) { //do something }
if(gameObjectToCheck.GetComponent<Rigidbody>() != null) { //do something }