title: GameObject can't find its parent
body: <p>I am trying to find the parent of a prefab object (a custom class that inherits from Toggle) dynamically doing this :</p>
  <pre><code>var parentObject = this.transform.parent;
  </code></pre>
  <p><strong>However, parentObject is returned null, despite the parent object existing and being interactable in the UI. Anyone knows what the reason could be? Am I doing it wrong?</strong></p>
  <p>I also tried running the following code :</p>
  <pre><code>if (this.transform.IsChildOf(transform))
  {
      Debug.Log(&quot;Object&quot; + this.ToString() + &quot; has parents&quot;);
  }
  </code></pre>
  <p>Which returns &quot;Object myPrefab (CustomToggle) has parents&quot;</p>