Answers for "unity set size"

C#
1

how to change the size of ui in script unity

_image.rectTransform.sizeDelta = new Vector2(width, height);
Posted by: Guest on March-19-2020
1

change size of a unity object

public GameObject cube;
    public Vector3 sizeChange; // This has to be set for (x,y,z) in the editor
    //public float cubeSize = 0.2f;

    void OnMouseDown()
    {
        cube.transform.localScale = cube.transform.localScale - sizeChange;    
    }
Posted by: Guest on October-20-2021

C# Answers by Framework

Browse Popular Code Answers by Language