unity set width and height of spriterenderer sprite code example
Example 1: how to change spriterenderer size from c# script
void Start() {
spriteRenderer = GetComponent<SpriteRenderer>();
spriteRenderer.drawMode = SpriteDrawMode.Tiled;
spriteRenderer.size = new Vector2(5,1);
}
Example 2: how to change spriterenderer size from c# script
sprRend.size = new Vector2(3, 1);