Picking Parent objects in script...

So, lets say i have objects like that in the Hierarchy:

Something:
   Something: <------ (3)
      Somthing
      Somthing <------ (1), (2)

Let’s say i would like to try to access script (2) from script (1)… I would use this gameObject.GetComponenet(ScriptName);
But what do i use when i try to acces script (3) from script (1) or (2) ?

You’d use:

gameObject.transform.parent.GetComponent(ScriptName);

Always cache your references to parent components though; you don’t want to be making that call every frame!

Yeah, thanks…

Ok, I was just curious… and now i know… thanks :stuck_out_tongue: