Probem with transform.IsChildOf

I have an odd problem with transform.IsChildOf… it doesnt seem to work in a specific instance in my scene.

GameObject TopNode = GameObject.Find(“shelves”);

if(currentPart.transform.IsChildOf(TopNode.transform) )
{…

Is child of seems to work everywhere else in my scene, but not here… I mean i have a work around where i can just put " || " in the if statement and search for the name of an object instead of looking to see if the currently clicked object is underneath the TopNode…,but still i want to know why this isnt working.

Here is an image of my hierachy.

434731--15117--$hierachy.jpg

Gameobject.Find only returns the first object that matches the query - that is, only the first object named shelves. If you have more than one you won’t get the behaviour you expect.

That was it! Thank you very much!