Scale GameObject in Unity

user3114190 picture user3114190 · Feb 7, 2014 · Viewed 31.2k times · Source

How can I increase / decrease the size of objects in Unity?

Example:

public GameObject sprite;

public float scale = 2.0f;

void ScaleResolution()

{

sprite = sprite*scale; //epic string!

}

Answer

It's a property of the transform component

sprite.transform.localScale = new Vector3(2.0f, 2.0f, 2.0f);