I am using the following code to shrink a sprite:
public bool shrinking = false;
public float targetScale = 0.1f;
public float shrinkSpeed = 0.1f;
void Update () {
if(shrinking) {
mySprite.transform.localScale -= Vector3.one * Time.deltaTime * shrinkSpeed;
if(mySprite.transform.localScale.x <= targetScale) {
shrinking = false;
}
}
}
However, no matter what I change shrinkSpeed
to, the object shrinks at the same rate. I know it probably has something to do with putting it in the update function but where should I move it to fix the problem?