Here’s the issue- Whenever I scale a cube, it scales evenly from both ends, from the center. What happens then is that the bottom of the cube penetrates through the surface below it. Is there any way to just scale “Upwards”? Or to reset the Y position so that the bottom of the cube will be sitting on the plane below it?
I suppose you could translate it based on the amount it scaled.
var newScale : Vector3 = new Vector3( 10f, 10f, 10f );
myGameObject.transform.localScale = newScale;
myGameObject.transform.position += new Vector3( 0f, newScale.y * 0.5f, 0f );