unity check if component has rigid body 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 }