unity how to change recttransform width and height via script code example Example: set width of rect transform unity rectTransform.sizeDelta = new Vector2(50, 50);