How to check if class has RequireComponent on it?

Hi, I’m trying to make a miniature of the player, by instantiating the player gameobject at start, and then stripping it off all the unnecessary things (colliders, rigidbodies…).

It works really well, apart for throwing errors all the time. “Can’t remove X because Y (Script) depends on it”.
I could probably live with these errors, but it makes it hard to read the console properly.

Is the any way I could check a component if it requires another component? I don’t even need the specific component it requires.

Yes, use

typeof(ComponentType).IsDefined(typeof(RequireComponent), false);