Place GameObject's rect
I have two cameras. I have an overlay camera rendering in the bottom left corner whilst the main camera is rendering as normal.
I want a gameobject to be the same size and position of the viewport rect that the overlay camera is rendering as a UI Object so essentially the rect transform sits on the UI the same way the overlay camera does in the game view.
So below I have the main camera's viewport rect in black and the overlay camera in blue. I would like a GameObject to have a rect transform that is the same as the blue square.
so you want a rect transform to be same size of the two cameras right ?
I would like a rect transform that is the same size as the overlay camera (blue square)
what about the bigger camera i hop you provided some code but for now let me show you something general :
public RectTransform rT;
void Start () {
rT.position = new Vector2(Screen.width/2,Screen.height/2);//pos center of any camera size
rT.sizeDelta = new Vector2 (Screen.width,Screen.height);//same size of any camera size
}