This is feeling like the kind of issue I should be slapped for being unable to figure out, but I’m pretty perplexed here.
I have an asset I’m scaling over time with this function because I want it to scale up to the “defaultLocalScale” which I save off from the object’s initial transform.localScale before scaling it down on spawn and slowly increasing the scale over time.
function SetScaleWithVector ( aScaleVector : Vector3 )
{
var theNewScale : Vector3 = defaultLocalScale;
theNewScale.x *= aScaleVector.x;
theNewScale.y *= aScaleVector.y;
theNewScale.z *= aScaleVector.z;
transform.localScale = theNewScale;
}
In this case the scale values start at 0.1 * 0.02 and gradually moves up to 1.0 * 0.02. Values in theNewScale match this when debug logged, but the model is much larger than when it’s merely displayed at its default scale, which was also 0.02.
I imagine there’s some behavior in localScale that I’m missing. Is this call not setting an absolute local scale? Are there gremlins!? I’ll be hacking this behavior away for now, but a correct understanding of the situation would be much appreciated.