How do I scale an object programmatically (Y axis)? I've looked through the docs because it seems to be such a simple thing but I honestly can't find it anywhere.
Thanks in advance!
How do I scale an object programmatically (Y axis)? I've looked through the docs because it seems to be such a simple thing but I honestly can't find it anywhere.
Thanks in advance!
I guess what you're looking for is the documentation of the Transform class
There, you'll find Transform.localScale
If you're using C# as scripting language, you can't just change the y-axis value. Instead, you'll have to use one of the following approaches:
Vector3 scale = transform.localScale;
scale.y = 5F; // your new value
transform.localScale = scale;
or
transform.localScale = new Vector3(transform.localScale.x, 5F, transform.localScale.y);
transform.localScale. (Everything related to Transform is here.)