Hello folks,
I’m resizing an object runtime by setting up assign different Vector3 value to the localScale value as seen below.
UpdateSize()
{
size += intensity * Time.deltaTime; // intensity varies by player’s input
cachedTransform.localScale = new Vector3(size, 1, size);
}
And what i’m seeing is that the app becomes pretty slower when ever the function is called… Is there a better way to implement this? I feel creating a new vector3 each frame is very expensive, but couldn’t find a way around, since x,y,z value of Vector3 is read-only.
Thanks in advance!