Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetWorldRect()

Returns the world-space axis-aligned bounding box of this RectTransform.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public Rect GetWorldRect()

Returns

Type

Description

RectA Rect describing the world-space bounding box. Width and height are always non-negative.

Remarks

The returned Rect is the smallest axis-aligned rectangle that encloses all four world-space corners of this RectTransform. For a RectTransform with non-zero Z rotation, the bounding box is larger than the element's nominal size.
Additional Resources: GetScreenRect, RectTransform.Contains.