unity set width and height of recttransform with scale code example Example: set width of rect transform unity rectTransform.sizeDelta = new Vector2(50, 50);