title: Unity sizeDelta height returns incorrect value
body: <p>I have this RectTransform:</p>
  
  <p><a href="https://i.stack.imgur.com/81vwQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/81vwQ.png" alt="enter image description here"></a></p>
  
  <p>Its part of my hover GUI. Everytime I hover over something the GUI is filled with information (because of this the height is dynamic) and moved to the object I hover over. </p>
  
  <p>Sometimes the GUI is offscreen and to move it back into view I need to know the current height.</p>
  
  <p>In the image above is an example, there the current height is 545.01, but my script logs a different height:</p>
  
  <pre><code>RectTransform hoverElementRect = instance.hoverGUI.GetComponent&lt;HoverGUI_Components&gt;().GetHoverElement().GetComponent&lt;RectTransform&gt;();
  
  Debug.Log(hoverElementRect.sizeDelta); // gives (450, 842)
  </code></pre>
  
  <p>How is this possible?</p>
  
  <p>I leave it for now without too much code, I am a newb in unity and maybe someone already has an idea, <a href="https://pastebin.com/1yzSHFu0" rel="nofollow noreferrer">but here is the whole GUI postioning and creating code</a>.</p>
  
  <p>The relevant part is at the end. </p>
  
  <p>EDIT:</p>
  
  <pre><code>foreach (RectTransform rect in instance.hoverGUI.GetComponent&lt;HoverGUI_Components&gt;().GetHoverElement().GetComponentsInChildren&lt;RectTransform&gt;()) {
      LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
      rect.ForceUpdateRectTransforms();
  }
  
  RectTransform hoverElementRect = instance.hoverGUI.GetComponent&lt;HoverGUI_Components&gt;().GetHoverElement().GetComponent&lt;RectTransform&gt;();
  
  LayoutRebuilder.ForceRebuildLayoutImmediate(hoverElementRect);
  hoverElementRect.ForceUpdateRectTransforms();
  </code></pre>
  
  <p>ForceUpdateRectTransforms() does not cahnge anything. I have even used it on all rects in the whole GUI object. I even tried to use it after each operation I have done. </p>