Hello,
I create a GameObject, and I associated a script with a function called “registerDocks()”.
Now this GameObject is a “container” for other game objects:
MASTER_GAME_OBJECT_1 <-- function is here!
|
+-Child_GO_1
+-Child_GO_2
+-Child_GO_3
|
MASTER_GAME_OBJECT_2 <-- function is here!
+-Child_GO_4
+-Child_GO_5
+-Child_GO_6
I need to call that function from Child objects.
I tried with (script in child):
transform.parent.registerDocks(this);
But Unity told me that “transform” object does not contain registerDocks().
HOw can I get access to the parent function and not to the “parent transform object”?
Please consider I do not want to use “Find()”. I need to work with the parent of an object.
Thank you for your help!