When a new UI object is created it starts off in the default scene and is lacking a RectTransform.
It only gets a RectTransform when a graphic component (Image,RawImage,Button) is added to it.
This intoduces bugs if send the RectTransform component firs and makes it impossible to create a GUI element without any graphical components (can't have multiple elements grouped under a single transform)
When a new UI object is created it starts off in the default scene and is lacking a RectTransform.
It only gets a RectTransform when a graphic component (Image,RawImage,Button) is added to it.
This intoduces bugs if send the RectTransform component firs and makes it impossible to create a GUI element without any graphical components (can't have multiple elements grouped under a single transform)