unity delete a component code example
Example 1: how to remove a component from an object in unity
Destroy(GetComponent<TheComponentYouWantToDestroy>());
Example 2: unity remove component
//Use Destroy() for removing components
Destroy(GetComponent<TheComponentYouWantToDestroy>());
//Use Destroy() for removing components