Hi I’m trying to implement an easy generic function
I want to find out if a component (like a script, collider, etc.) is attached to an transform node.
Actually GetComponent should return null if that Kind of Type is not attached.
What am I doing wrong?
Here some code snippets:
public static bool rootParentHasComponent(Transform node) {
//…
if(node.GetComponent()!=null) return true;
//…
}